Updated npm packages and migrated webpack css plugin

This commit is contained in:
Dan Brown
2019-02-03 18:21:21 +00:00
parent 49deab3a02
commit 67d4fa0c65
3 changed files with 477 additions and 2537 deletions

View 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',
@ -35,12 +35,15 @@ const config = {
},
{
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: {
@ -54,13 +57,15 @@ const config = {
loader: "sass-loader", options: {
sourceMap: dev
}
}]
})
}
]
}
]
},
plugins: [
new ExtractTextPlugin("[name].css"),
new MiniCssExtractPlugin({
filename: "[name].css",
}),
]
};