]> BookStack Code Mirror - bookstack/blobdiff - webpack.config.js
Update Spanish translation
[bookstack] / webpack.config.js
index 5abde44231910f58ee02e406af892b5771fa6df3..78b679a0a82f51fab622fb35ff60c0dece578119 100644 (file)
@@ -1,7 +1,7 @@
 const path = require('path');
 const dev = process.env.NODE_ENV !== 'production';
 
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
 
 const config = {
     target: 'web',
@@ -18,60 +18,35 @@ const config = {
     },
     module: {
         rules: [
-            {
-                test: /\.js$/,
-                exclude: /(node_modules)/,
-                use: {
-                    loader: 'babel-loader',
-                    options: {
-                        presets: ['@babel/preset-env']
-                    }
-                }
-            },
             {
                 test: /\.scss$/,
-                use: [{
-                    loader: 'file-loader',
-                    options: {
-                        name: '[name].css',
-                        context: './src/css/',
-                        outputPath: './',
-                        publicPath: 'public/'
-                    }
-                }, {
-                    loader: 'extract-loader', options: {
-                        publicPath: '',
-                    }
-                }, {
-                    loader: "css-loader", options: {
+                use: [
+                    {
+                        loader: MiniCssExtractPlugin.loader,
+                        options: {}
+                    },
+                    {
+                        loader: "css-loader", options: {
                         sourceMap: dev
                     }
-                }, {
-                    loader: 'postcss-loader',
-                    options: {
-                        ident: 'postcss',
-                        sourceMap: dev,
-                        plugins: (loader) => [
-                            require('autoprefixer')(),
-                        ]
+                    }, {
+                        loader: "sass-loader", options: {
+                            sourceMap: dev
+                        }
                     }
-                }, {
-                    loader: "sass-loader", options: {
-                        sourceMap: dev
-                    }
-                }]
+                ]
             }
         ]
     },
-    plugins: []
+    plugins: [
+        new MiniCssExtractPlugin({
+            filename: "[name].css",
+        }),
+    ]
 };
 
 if (dev) {
     config['devtool'] = 'inline-source-map';
 }
 
-if (!dev) {
-    config.plugins.push(new UglifyJsPlugin());
-}
-
 module.exports = config;
\ No newline at end of file