Skip to content

Commit c86e8a9

Browse files
committed
Removed CommonSplitPlugin for SplitChunks
1 parent f0518b2 commit c86e8a9

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

client/package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@
4141
"lint": "eslint --ext .js,.jsx ."
4242
},
4343
"dependencies": {
44+
"@babel/core": "^7.3.4",
45+
"@babel/preset-env": "^7.3.4",
4446
"actioncable": "5.0.x",
4547
"autoprefixer": "^7.1.5",
4648
"axios": "^0.17.1",
4749
"babel-cli": "^6.26.0",
4850
"babel-core": "^6.26.0",
49-
"babel-loader": "^7.1.2",
51+
"babel-loader": "^7.1.5",
5052
"babel-plugin-transform-es2015-modules-amd": "^6.24.1",
5153
"babel-polyfill": "^6.26.0",
5254
"babel-preset-env": "^1.6.0",
@@ -56,13 +58,13 @@
5658
"bootstrap-loader": "^2.2.0",
5759
"bootstrap-sass": "^3.3.7",
5860
"classnames": "^2.2.5",
59-
"compression-webpack-plugin": "^1.0.1",
61+
"compression-webpack-plugin": "^2.0.0",
6062
"css-loader": "^0.28.7",
6163
"es5-shim": "^4.5.9",
6264
"estraverse": "^4.2.0",
63-
"expose-loader": "^0.7.4",
65+
"expose-loader": "^0.7.5",
6466
"extract-text-webpack-plugin": "^3.0.2",
65-
"file-loader": "^1.1.5",
67+
"file-loader": "^3.0.1",
6668
"glob": "^7.1.2",
6769
"immutable": "^3.8.2",
6870
"imports-loader": "^0.7.1",
@@ -72,8 +74,8 @@
7274
"js-yaml": "^3.10.0",
7375
"loader-utils": "^1.1.0",
7476
"lodash": "^4.17.4",
75-
"marked": "^0.3.6",
76-
"node-sass": "^4.7.2",
77+
"marked": "^0.6.1",
78+
"node-sass": "^4.11.0",
7779
"node-uuid": "^1.4.8",
7880
"postcss-loader": "^2.0.8",
7981
"prop-types": "^15.6.0",
@@ -91,12 +93,13 @@
9193
"redux-thunk": "^2.2.0",
9294
"resolve-url-loader": "^2.2.0",
9395
"sass-loader": "^6.0.6",
94-
"sass-resources-loader": "^1.3.1",
96+
"sass-resources-loader": "^1.3.3",
9597
"style-loader": "^0.19.0",
9698
"turbolinks": "^5.0.3",
9799
"url-loader": "^0.6.2",
98-
"webpack": "^3.8.1",
99-
"webpack-manifest-plugin": "^1.3.2",
100+
"webpack": "^4.29.6",
101+
"webpack-cli": "^3.3.0",
102+
"webpack-manifest-plugin": "^2.0.4",
100103
"webpack-merge": "^4.1.1"
101104
},
102105
"devDependencies": {
@@ -114,11 +117,11 @@
114117
"express": "^4.16.2",
115118
"identity-obj-proxy": "^3.0.0",
116119
"jest": "^23.5.0",
117-
"pug": "^2.0.0-rc.4",
120+
"pug": "^2.0.3",
118121
"react-transform-hmr": "^1.0.4",
119122
"regenerator-runtime": "^0.12.1",
120123
"sleep": "^5.1.1",
121-
"webpack-dev-server": "^2.9.4"
124+
"webpack-dev-server": "^3.2.1"
122125
},
123126
"jest": {
124127
"moduleNameMapper": {

client/webpack.client.base.config.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616

1717
// the project dir
1818
context: resolve(__dirname),
19+
mode: process.env.NODE_ENV,
1920
entry: {
2021
// This will contain the app entry points defined by
2122
// webpack.client.rails.hot.config and webpack.client.rails.build.config
@@ -45,28 +46,25 @@ module.exports = {
4546
'client/node_modules',
4647
],
4748
},
48-
49+
optimization: {
50+
splitChunks: {
51+
chunks: 'all',
52+
cacheGroups: {
53+
vendor: {
54+
name: 'vendor',
55+
test: /[\\/]node_modules[\\/]/,
56+
priority: -10,
57+
}
58+
}
59+
}
60+
},
4961
plugins: [
5062
new webpack.EnvironmentPlugin({
5163
NODE_ENV: 'development', // use 'development' unless process.env.NODE_ENV is defined
5264
DEBUG: false,
5365
TRACE_TURBOLINKS: devBuild,
5466
}),
55-
5667
// https://webpack.github.io/docs/list-of-plugins.html#2-explicit-vendor-chunk
57-
new webpack.optimize.CommonsChunkPlugin({
58-
59-
// This name 'vendor-bundle' ties into the entry definition
60-
name: 'vendor-bundle',
61-
62-
// We don't want the default vendor.js name
63-
filename: 'vendor-bundle-[hash].js',
64-
65-
minChunks(module) {
66-
// this assumes your vendor imports exist in the node_modules directory
67-
return module.context && module.context.indexOf('node_modules') !== -1;
68-
},
69-
}),
7068
new ManifestPlugin({
7169
publicPath: output.publicPath,
7270
writeToFileEmit: true

0 commit comments

Comments
 (0)