I am using angular cli for my angular 2 application. After npm run build, dist folder is created. When I open index.html of dist folder, it cannot find files like inline.bundle.js, polyfills.bundle.js etc. I need to give an absolute path for these files so that I can run my project. Please help.
TO RESOLVE THIS ISSUE OF PROVIDING THE ABSOLUTE PATH
Please use the command below to generate the build of project using angular cli
Command for the dev build
ng build --base-href ./
for the production build
ng build --prod --base-href ./
Base-href is used to notify the path of js file located at.
I used this and working fine:
ng build --base-href 'SERVER_APPLICATION_PATH'
LIKE AS
ng build --base-href 'http://localhost/web/angular-first/'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.