question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`--base-href` to be configurable in `.angular-cli.json`

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.0.2
node: 6.9.4
os: linux x64
@angular/animations: 4.1.1
@angular/common: 4.1.1
@angular/compiler: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/platform-server: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.1
@angular/language-service: 4.1.1

Desired functionality.

I need to configure multiple apps with different --base-href values. Right now the only place where I can set this setting is via command line, but that leads to too complex NPM scripts. A better solution would be a setting inside the app array of .angular-cli.json. We already have deployUrl, so I don’t understand why there is no baseHref yet.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:19
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
meyacinecommented, Oct 19, 2017

just add “baseHref” : “YOUR_CUSTOM_HREF” to the “apps” in the angular-cli.json

{
   ....
 "apps": [
    {
       "baseHref" : "YOUR_CUSTOM_HREF"
     }
  ],
}
3reactions
rkrisztiancommented, May 27, 2017

Thanks!

I’ve just noticed, #3010 already considered this feature, but then got dismissed due to the last comment realizing that it is enough to change the base href in the index.html. However, when multiple app configurations are needed, editing index.html is no longer a practical solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

override baseHref for ng serve in Angular 14 - Stack Overflow
I have a set "baseHref" to '/bui' in the angular.json file because the static files are deployed there. If I use ng serve...
Read more >
baseHref setting in angular.json - Ionic Forum
Is there an easy way for me to configure things so that I can get things working across all three platforms with a...
Read more >
angular-cli-ghpages - Google Dev Library | What will you build?
Deploy your Angular app to GitHub pages directly from the Angular CLI! ... NPM package and add the necessary deploy configuration to your...
Read more >
How to make Angular CLI built app work from a subfolder
There are 2 possible solutions - use the CLI parameter, or set the value in the angular.json file. CLI parameter. angular build accepts...
Read more >
.angular-cli.json XML Schema Documentation
JSON Schema Diagram of /properties/apps/items[0] ... baseHref, string, A String value ... The name of the TypeScript configuration file for unit tests.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found