Keshav Dhawan
Keshav Dhawan

Reputation: 39

Absolute path in angular cli

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.

Upvotes: 1

Views: 3141

Answers (2)

Raman Singh
Raman Singh

Reputation: 75

I used this and working fine:

ng build --base-href 'SERVER_APPLICATION_PATH'

LIKE AS

ng build --base-href 'http://localhost/web/angular-first/'

Upvotes: 1

Sahil Kashetwar
Sahil Kashetwar

Reputation: 167

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.

Upvotes: 2

Related Questions