X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/e52bfc0c241f1004d39652b6a365c6a6fda94367..refs/pull/806/head:/webpack.config.js diff --git a/webpack.config.js b/webpack.config.js index 0f54147a0..c5ce4829f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,12 +4,9 @@ const dev = process.env.NODE_ENV !== 'production'; const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const extractSass = new ExtractTextPlugin({ - filename: "[name].css" - // disable: process.env.NODE_ENV === "development" -}); - const config = { + target: 'web', + mode: dev? 'development' : 'production', entry: { app: './resources/assets/js/index.js', styles: './resources/assets/sass/styles.scss', @@ -34,23 +31,33 @@ const config = { }, { test: /\.scss$/, - use: extractSass.extract({ + use: ExtractTextPlugin.extract({ + fallback: "style-loader", use: [{ loader: "css-loader", options: { sourceMap: dev } + }, { + loader: 'postcss-loader', + options: { + ident: 'postcss', + sourceMap: dev, + plugins: (loader) => [ + require('autoprefixer')(), + ] + } }, { loader: "sass-loader", options: { sourceMap: dev } - }], - // use style-loader in development - fallback: "style-loader" + }] }) } ] }, - plugins: [extractSass] + plugins: [ + new ExtractTextPlugin("[name].css"), + ] }; if (dev) {