I'm using dynamic imports in a JS project with Webpack, and the chunks created from the dynamic imports have corresponding vendors~[name].chunk.js chunks. I'd like to include the vendors chunk inside the corresponding [name].chunk.js, i.e. not split it off into its own chunk.
webpack config:
module.exports = {
output: {
// ...
chunkFilename: '[name].chunk.js',
},
}
app code:
const Component = React.lazy(() =>
import(/* webpackChunkName: "component" */ './Component')
);
produces
vendors~component.chunk.js and component.chunk.js