Answer the question
In order to leave comments, you need to log in
How to set up the webpack CommonsChunkPlugin properly for a project?
I'm trying to set up a react project to connect scripts depending on the user's role.
there are production build settings
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
new CommonsChunkPlugin({
name: "admin-commons",
chunks: ["adminPageA", "adminPageB"]
}),
new CommonsChunkPlugin({
name: "commons",
chunks: ["pageA", "pageB", "admin-commons.js"],
minChunks: 2
})
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