I am using angular-cli 1.0.0-beta.24. When I run ng build --production
, is there a way to change the name of the generated *.bundle.css and *.bundle.js files?
The default names are: main.[hash].bundle.js, styles.[hash].bundle.css, vendor.[hash].bundle.js and inline.[hash].bundle.js and I would like to change these. Also this should reflect in automatic change of the generated css/script links in index.html.
Thanks in advance.
I think you can remove the hashes by providing --output-hashing none
Sadly for now you can't do that.
There is a thread discussing this issue here: https://github.com/angular/angular-cli/issues/1656
According to the team they do not intend to allow customization of the Webpack configuration (Webpack is the tool that generates the transpiled files) anytime soon.
Changing the code in the files will update the [hash] in the vendor and main files but inline and styles will always have the same hash...
Someone in this thread suggested using the following seed which allows you to update the Webpack configuration of your Angular app (and seems to also support AOT and SSR) but I have not tested it to see if it actually works and it is not part of the angular-cli project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With