Skip to content

Commit

Permalink
Update webpack.client.base.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Oct 25, 2015
1 parent a2aa175 commit a3d70dd
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions client/webpack.client.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,35 @@ module.exports = {
// the project dir
context: __dirname,
entry: {

// See use of 'vendor' in the CommonsChunkPlugin inclusion below.
vendor: [
'babel-core/polyfill',
'jquery',
'jquery-ujs',
'react',
'react-dom',
],
app: ['babel-core/polyfill'],

// This will contain the app entry points defined by webpack.hot.config and webpack.rails.config
app: [],
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'],
},
plugins: [

// https://webpack.github.io/docs/list-of-plugins.html#2-explicit-vendor-chunk
new webpack.optimize.CommonsChunkPlugin({

// This name 'vendor' ties into the entry definition
name: 'vendor',
chunks: ['app'],

// We don't want the default vendor.js name
filename: 'vendor-bundle.js',

// Passing Infinity just creates the commons chunk, but moves no modules into it.
// In other words, we only put what's in the vendor entry definition in vendor-bundle.js
minChunks: Infinity,
}),
],
Expand Down

0 comments on commit a3d70dd

Please sign in to comment.