1

I searched, but I could not find a solution to this problem. Maybe I'm just doing something very wrong. I have an Angular 7 app, when I build it, it geneates a nicelly built project in /dist. But when I change something for a new release, my build does not change.

Let's say I have a file called 'dashboard', if I just add something like 'TEST TEST TEST TEST TEST.......', it does not display on my new build, but it does when I ng serve..
What am I doing wrong here? I have to completely reinstall npm to get my new build to work, but that's far to impractical.

3
  • 1
    Are you running ng build again after the changes to the source code? If yes, what if you delete dist/ entirely in-between? Commented Feb 11, 2019 at 11:39
  • as @jonrsharpe said you need to run ng build again and hard refresh the the browser may be some cache issue. Commented Feb 11, 2019 at 11:41
  • @jonrsharpe even after deleting /dist, the files generated are the exact same Commented Feb 11, 2019 at 11:47

1 Answer 1

3

You don't have cache busting.

Either use the prod flag, which contains it :

ng build --prod

Or explicitly tell it :

ng build --output-hashing=all

(instead of all you can also use bundles to hash only the bundles of JS created by your app code, and not all the files like pictures, styles, etc.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.