I have my angular2 application in production. And whenever i deploy a new version of my application for some time (due to caching of index.html) the old index.html is served and since the old js files gets replaced with new js files I get 404 errors for my old js files.
Though this problem goes away with time I wanted a angular-cli
build solution such that I can keep the old files on my server and remove it after next 2 subsequent releases.
I tried doing this in my jenkins,
ng build -prod -aot --base-href="/myapp/10.5.0/"
But the problem is, whenever I deploy this app the following folder path gets attached to the address-bar URL http://localhost/myapp/10.5.0/
I don't want to append the base-href to be attached to the URL.
In-case I achieve this, Than I can have many version folders and the old (cached) index.html will serve from the old folder and would still work without giving 404 errors.
Any help will be much appreciated.