Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack.client.base.config.js #130

Merged
merged 1 commit into from
Oct 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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