Why would webpack 4 generate files named 0.js, 1.js 2.js?
Each x.js
file is created from dynamic import in your code.
Webpack supports import()
& require.ensure()
syntax.
Both of them supports chunk naming:
import()
- with a comment
import(/* webpackChunkName: "my-chunk-name" */ 'my-comp');
require.ensure()
- specifying the 4th parameter
require.ensure(['b'], function(require) {
var c = require('c');
}, console.error, 'chunkName');
-----------------------^