I have a project that looks like this:
- app.js
- module1.js
- node_modules
module1 is imported dynamically in app.js via import(/* webpackChunkName: 'module1' */ '@path')
.
I'm trying to configure the splitChunks plugin so it would output:
- app chunk including src code without dependencies and packages;
- module1 chunk that includes both the source code AND required dependencies from node_modules for the dynamically imported module;
- vendor chunk that includes the rest of the dependencies from node_modules;
What is the best way to do that? The application has a single entry, which is app.js