18

When we create build for production then we use a command as -

ng build --aot --output-hashing=all --prod --base-href "/xyz/" --deploy-url "/xyz/"

What is use of --output-hashing=all?

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
Praveen Barawal
  • 191
  • 1
  • 1
  • 5
  • In the Angular documentation https://angular.io/cli/build you can see what each option is doing. – Achilles Moraites Sep 12 '20 at 05:46
  • 1
    the explanation to your question can be obtained in another question : https://stackoverflow.com/questions/55402751/angular-app-has-to-clear-cache-after-new-deployment/55403095#55403095 – Joel Joseph Oct 26 '21 at 07:58

1 Answers1

21

From Angular Documentation:

Define the output filename cache-busting hashing mode.

So, if your parameter is all, your generated files would look like:

main.62beb1fb93041eb44194.js
Asaf
  • 1,446
  • 9
  • 17
  • 1
    Right, they are generated as such, but even after clearing browser cache it's still trying to find the js files without the #'s in their name. So "chunk load failed" is appearing in browser console and pages are not accessible. – Collin Nov 14 '22 at 22:09