Skip to content

Commit 9a4e771

Browse files
committed
Merge pull request shakacode#130 from shakacode/justin808-refactor-webpack-config
Update webpack.client.base.config.js
2 parents a2aa175 + a3d70dd commit 9a4e771

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

client/webpack.client.base.config.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,35 @@ module.exports = {
77
// the project dir
88
context: __dirname,
99
entry: {
10+
11+
// See use of 'vendor' in the CommonsChunkPlugin inclusion below.
1012
vendor: [
13+
'babel-core/polyfill',
1114
'jquery',
1215
'jquery-ujs',
16+
'react',
17+
'react-dom',
1318
],
14-
app: ['babel-core/polyfill'],
19+
20+
// This will contain the app entry points defined by webpack.hot.config and webpack.rails.config
21+
app: [],
1522
},
1623
resolve: {
1724
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'],
1825
},
1926
plugins: [
27+
28+
// https://webpack.github.io/docs/list-of-plugins.html#2-explicit-vendor-chunk
2029
new webpack.optimize.CommonsChunkPlugin({
30+
31+
// This name 'vendor' ties into the entry definition
2132
name: 'vendor',
22-
chunks: ['app'],
33+
34+
// We don't want the default vendor.js name
2335
filename: 'vendor-bundle.js',
36+
37+
// Passing Infinity just creates the commons chunk, but moves no modules into it.
38+
// In other words, we only put what's in the vendor entry definition in vendor-bundle.js
2439
minChunks: Infinity,
2540
}),
2641
],

0 commit comments

Comments
 (0)