EN
Preact / WebPack - how to disable *.js and *.css bundle chunk names shortcuting? (short names disabling)
1
answers
7
points
I have noiticed, when I use multiple routings that import same module, the WebPack creates short bundle chunk names, e.g.
route-home~route-pictures~route-messages~route-admin~s~d3492c2c.chunk.1c736.css
^
|
I want to disable this shortcutting.
Is it possible to disable this feature?
I whould like to use full route names.
Desired bundle name that I would like to get should be:
route-home~route-pictures~route-messages~route-admin~route-store.chunk.1c736.css
1 answer
7
points
Try to add to the project root the following file preact.config.js:
export default (config, env) => {
config.optimization.splitChunks.cacheGroups = {
commons: {
chunks: 'all',
name: (module, chunks) => {
return chunks.filter(item => item.name).map(item => item.name).join('~');
}
}
};
};
References
0 comments
Add comment