About webpack — Named chunks.

After long shoveling…. I got it.. Stupid!!

webpack.confing.js

output: {
path: ...,
filename: ...,
chunkFilename: '[name].js',
publicPath: ...
},

Before:

require.ensure([], (r) => require('./LazyMoudle'))

The chunk file name will be “1.js”.. Whattttt? I want to make like this . “LazyModule.js”..

After :

require.ensure([], (r) => require('./LazyMoudle'), 'LazyMoudle')

Then, webpack made this chunk file name to “LazyModule.js”

This is a named chunks manual.

In the example is great but a little bit ambiguous for me. There is no any mention about the last parameter will be chunked name.

Actually There is ..

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.