about summary refs log tree commit diff
path: root/config/webpack/loaders/assets.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack/loaders/assets.js')
-rw-r--r--config/webpack/loaders/assets.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/config/webpack/loaders/assets.js b/config/webpack/loaders/assets.js
new file mode 100644
index 000000000..595f073fc
--- /dev/null
+++ b/config/webpack/loaders/assets.js
@@ -0,0 +1,12 @@
+const { env, publicPath } = require('../configuration.js')
+
+module.exports = {
+  test: /\.(jpg|jpeg|png|gif|svg|eot|ttf|woff|woff2)$/i,
+  use: [{
+    loader: 'file-loader',
+    options: {
+      publicPath,
+      name: env.NODE_ENV === 'production' ? '[name]-[hash].[ext]' : '[name].[ext]'
+    }
+  }]
+}