Merge pull request #4 from prymitive/greenkeeper/webpack-4.12.0

Update webpack to the latest version 🚀
This commit is contained in:
Łukasz Mierzwa
2018-06-12 12:49:02 +02:00
committed by GitHub
3 changed files with 1208 additions and 252 deletions
+1187 -244
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -71,10 +71,12 @@
"mock-xhr": "^0.1.0",
"node-sass": "^4.9.0",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^7.0.1",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^1.0.1",
"webpack": "^3.8.1",
"webpack": "^4.12.0",
"webpack-cli": "^3.0.3",
"window": "^4.2.5"
}
}
+17 -6
View File
@@ -2,6 +2,7 @@ const webpack = require("webpack");
const path = require("path");
const fs = require("fs");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
var config = {
cache: true,
@@ -16,6 +17,22 @@ var config = {
publicPath: "static/dist/",
filename: "[name].[chunkhash].js"
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "shared",
chunks: "all"
}
}
},
minimizer: [
new UglifyJsPlugin({
sourceMap: true
})
]
},
plugins: [
new webpack.PrefetchPlugin(path.join(__dirname, "assets/static/unsee.js")),
new webpack.PrefetchPlugin(path.join(__dirname, "assets/static/help.js")),
@@ -25,9 +42,6 @@ var config = {
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new CleanWebpackPlugin([ "assets/static/dist" ]),
new webpack.optimize.CommonsChunkPlugin({
name: "shared"
}),
// this will generate loader_${name}.html files that will have
// a <script/> line for loading hashed chunk
// inspited by https://github.com/webpack/webpack/issues/86
@@ -112,9 +126,6 @@ const isDev = (process.env.NODE_ENV === "test");
// enable production only plugins
if (!isDev) {
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
sourceMap: true
}));
config.plugins.push(new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,