1

I used angular-cli (version 1.0.2) to create an angular project, but I need to run from index-dev.html instead of index.html, and index-dev.html will have the same content as index.html, just naming file differently.

Without using angular-cli, I can config lite-server in bs-config.json file. But how can I config in angular-cli project?

2 Answers 2

1

Steps:

  1. Go to .angular-cli.json file
  2. Under "apps" section find the property "index"
  3. Change the value of this property to "index-dev.html" from "index.html"
Sign up to request clarification or add additional context in comments.

Comments

1

Update angular-cli file.

{

  "apps": [
    {

      "index": "index-dev.html",
}
}

5 Comments

Thanks @Jonnysai but it doesn't work. Here is the error Error: Child compilation failed: Entry module not found: Error: Can't resolve 'project-name/src/index-dev.html' in 'project-name':
Error showing that Cli was unable find index-dev.html inside src folder. is your index-dev.html included in src folder ? if its present try run ng serve once again
my bad, I have accidentally created two index.html and renamed the wrong one.
Will it be the same case if I want to add parameter after index-dev.html, for example, change to index-dev.html?debug=true in .angular-cli.json? If I made this change, it give me 404 error in debug tool network tab when fetching package.json.
I dont know whether we can do like that. but you can try with route. stackoverflow.com/questions/39858471/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.