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
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 477 additions and 2537 deletions

2979
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,17 +13,17 @@
"@babel/core": "^7.1.6",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.6",
"autoprefixer": "^8.6.5",
"autoprefixer": "^9.4.7",
"babel-loader": "^8.0.4",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"css-loader": "^2.1.0",
"livereload": "^0.7.0",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.10.0",
"npm-run-all": "^4.1.5",
"postcss-loader": "^2.1.6",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.21.0",
"uglifyjs-webpack-plugin": "^1.3.0",
"style-loader": "^0.23.1",
"uglifyjs-webpack-plugin": "^2.1.1",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
},

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",
}),
]
};