I'm using angular-cli-1.6.3 for bundling my project. I try to rename lazy loaded chunk name into valid module name. But it is not working. Code snippet given below,
{
path: 'lazy',
loadChildren: './lazy/module#LazyModule?chunkName=LazyModule'
}
I'm using angular-cli-1.6.3 for bundling my project. I try to rename lazy loaded chunk name into valid module name. But it is not working. Code snippet given below,
{
path: 'lazy',
loadChildren: './lazy/module#LazyModule?chunkName=LazyModule'
}
you should be using -nc
flag
ng build --aot -nc
or
ng build --aot --named-chunks
Update 1 : Based on Comment
to remove the hash numbers set the --output-hashing
to false as below
ng build --aot --nc --output-hashing=false
lazy.module.chunk.js
will be the file name created –
Anhwei ng build --namedChunks=true --outputHashing=none --vendorChunk=true
namedChunks
Use file name for lazy loaded chunksoutput-hashing
Define the output filename cache-busting hashing mode.vendorChunk
Use a separate bundle containing only vendor libraries.© 2022 - 2024 — McMap. All rights reserved.
?chunkName=LazyModule
? where did you got that from? – Landgravine