Incorrect JS paths when ng build -prod is deployed in a subfolder
Please provide us with the following information:
- OS?
Windows 10
- Versions: angular-cli: 1.0.0-beta.5 node: 4.4.5 os: win32 x64
- Repro steps:
- Fresh app created by "ng new datamatic"
- Then build "ng build prod"
- /dist folder deployed to http://datamatic.co/angular2-test/
- The log given by the failure:
Browser log when accessing http://datamatic.co/angular2-test/:

Files are loaded relative to the domain, not the folder
@MarcoHeumann but that would introduce the problem in reloading the page. Because when reloading it uses the current path as the base path. I am having the same issue. I still haven't figured out the clean and permanent solution. Though if you don't care about deploying to different paths or folders, there are two ways with absolute path: update base-href in index.html after war file is built or use it in ng build -base-href command.
This will work
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.