Angular is generating random names for the files when running ng build --prod
. Is there a way to specify the names we want? We are using angular-cli
. We really need this as our angular application is embedded inside a CMS platform.
I think you can.
use the standard names like inline.bundle.js vendor.bundle.js , main.bundle.js this are enable in dev mode, but if you want to have the names in prod mode. In your case,
ng build --prod
you can use the following flag to avoid the hashing
ng build --prod --output-hashing none
Now it is possible by setting up namedChunks: true
in the file angular.json
. It will leave generated readable name for chanks, same as you see when starting a project by ng start
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.