about summary refs log tree commit diff
path: root/config/webpack/loaders
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2018-07-14 10:56:41 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-07-14 03:56:41 +0200
commite9b322d0a6bebe7d13a53a216482ecc364f18806 (patch)
treeb775933f5fce4df3c563d45c1e675189b6444dd2 /config/webpack/loaders
parente7091074636c519a5c0bd52c8ef85fa3c5df4656 (diff)
Upgrade webpack to version v4.x (#6655)
Diffstat (limited to 'config/webpack/loaders')
-rw-r--r--config/webpack/loaders/sass.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/config/webpack/loaders/sass.js b/config/webpack/loaders/sass.js
index 88d94c684..bad09ceb4 100644
--- a/config/webpack/loaders/sass.js
+++ b/config/webpack/loaders/sass.js
@@ -1,15 +1,22 @@
-const ExtractTextPlugin = require('extract-text-webpack-plugin');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const { env } = require('../configuration.js');
 
 module.exports = {
-  test: /\.(scss|sass|css)$/i,
-  use: ExtractTextPlugin.extract({
-    fallback: 'style-loader',
-    use: [
-      { loader: 'css-loader', options: { minimize: env.NODE_ENV === 'production' } },
-      { loader: 'postcss-loader', options: { sourceMap: true } },
-      'resolve-url-loader',
-      'sass-loader',
-    ],
-  }),
+  test: /\.s?css$/i,
+  use: [
+    MiniCssExtractPlugin.loader,
+    {
+      loader: 'css-loader',
+      options: {
+        minimize: env.NODE_ENV === 'production',
+      },
+    },
+    {
+      loader: 'postcss-loader',
+      options: {
+        sourceMap: true,
+      },
+    },
+    'sass-loader',
+  ],
 };