Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to generate different js files name using ng build?

I created an angular 14 app and its when I am using ng build to deploy the app to the web server. it always generate the same js files names, which make problem by the user that they need always to clear the cache in each time there is an update to the website, ho to solve this , or how to generate always different js files names?

i changed the names manually

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The –output-hashing option without a parameter generates unique filenames only for files that have changed since the last "ng build" command.

ng build –output-hashing

The –output-hashing option with the "all" parameter generates unique filenames for all output files, whether they have been changed or not.

ng build –output-hashing=all

For example, if you use the –output-hashing option without a parameter, and then re-execute "ng build" without changing the files that were generated during the last execution, the files will keep their original names and no new names will be generated.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading