Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular build index.html not working

I have taken the build of angular project and got dist folder.when i am trying to open the index.html in browser.I am getting the following error like failed to load resources and file not found for inline.bundle.js ,polyfil.bundle.js and many files. enter image description here Though this files added in the script tag and i didnt change the path of this file still not working.But if i run this from live server it is working. enter image description here Explain why it is not working without server? Why it is not loading the inline.bundle.js,polyfill.bundle.js which are js file?

like image 703
John Willson Avatar asked Mar 07 '18 09:03

John Willson


1 Answers

Your files are not found because base URL changed.

You can workaround this one by using <base href="./"> in your index.html.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

like image 71
Zooly Avatar answered Sep 17 '22 12:09

Zooly