Answer the question
In order to leave comments, you need to log in
How does CommonsChunkPlugin work in Webpack?
For example, I have a build (610kb) I want to split it into pieces of 200kb.
entry : {
app: './client/client.js',
vendor: [ 'react', 'react-dom', 'react-router', 'react-addons-css-transition-group' ],
vendor2: [ 'redux', 'react-redux', 'react-dnd', 'react-dnd-html5-backend' ],
vendor3: ['react-modal', 'reduce-reducers', 'redux-actions']
},
entry : {
app: './client/client.js',
vendor: [ 'react', 'react-dom', 'react-router', 'react-addons-css-transition-group' ],
},
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'vendor2', 'vendor3'],
}),
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question