Since Webpack@3.0.0 we have this wonderful feature that allows named chunk files:
import(
'module'
);
However, I am at a point where I have 40 such imported imports, and changing each of them is a bit of a hassle.
Is there a way to define webpackChunkNameand webpackModeglobally for all the pieces?
I present something like this in webpack.config.js:
output: {
filename: 'js/[name].js',
chunkFilename: 'js/[filename].js' // so that import('module') creates module.js
chunkMode: 'lazy-once' // so I can override default `lazy` option once and for all
}
source
share