]> BookStack Code Mirror - bookstack/blobdiff - webpack.config.js
Update settings.php
[bookstack] / webpack.config.js
index c5ce4829fde1c99caf55ccd6025cbfb91c6971ae..4eae9b9be34683eec0f4efd08f039762e556c6ac 100644 (file)
@@ -2,7 +2,7 @@ const path = require('path');
 const dev = process.env.NODE_ENV !== 'production';
 
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
-const ExtractTextPlugin = require("extract-text-webpack-plugin");
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
 
 const config = {
     target: 'web',
@@ -25,18 +25,25 @@ const config = {
                 use: {
                     loader: 'babel-loader',
                     options: {
-                        presets: ['@babel/preset-env']
+                        presets: [[
+                            '@babel/preset-env', {
+                                useBuiltIns: 'usage'
+                            }
+                        ]]
                     }
                 }
             },
             {
                 test: /\.scss$/,
-                use: ExtractTextPlugin.extract({
-                    fallback: "style-loader",
-                    use: [{
+                use: [
+                    {
+                        loader: MiniCssExtractPlugin.loader,
+                        options: {}
+                    },
+                    {
                         loader: "css-loader", options: {
-                            sourceMap: dev
-                        }
+                        sourceMap: dev
+                    }
                     }, {
                         loader: 'postcss-loader',
                         options: {
@@ -50,13 +57,15 @@ const config = {
                         loader: "sass-loader", options: {
                             sourceMap: dev
                         }
-                    }]
-                })
+                    }
+                ]
             }
         ]
     },
     plugins: [
-        new ExtractTextPlugin("[name].css"),
+        new MiniCssExtractPlugin({
+            filename: "[name].css",
+        }),
     ]
 };