Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : ng build to include a --base-href <base> #1064

Closed
timlevett opened this issue Jun 11, 2016 · 4 comments
Closed

Feature Request : ng build to include a --base-href <base> #1064

timlevett opened this issue Jun 11, 2016 · 4 comments
Labels
effort1: easy (hours) feature Issue that requests a new feature P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Comments

@timlevett
Copy link

Much like what happens as part of github deploy, have a feature that you can supply a base-href that will be added to the index.html during the ng build command

Usage : ng build --base-href <base>
Example : ng build --base-href home
Replaces <base href="/"> with <base href="/home"> in index.html

@filipesilva filipesilva added feature Issue that requests a new feature P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent effort1: easy (hours) labels Jun 18, 2016
@filipesilva filipesilva added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 28, 2016
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 29, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
@dzonatan
Copy link
Contributor

dzonatan commented Jul 29, 2016

I've started and actually did some work on this because I missed it in webpack version.. and I really need it. :|

To make sure I'm in the right way I need someone of angular members approval about how this argument should work.
Is it good for you to have such case scenarios:

  • if no --base-href tag provided then do nothing (keep the template index.html untouched). In such case the user is able to use base tag purely. This also ensures to don't have any breaking changes.
  • if --base-href x provided and base tag doesn't exists then insert <base href="x"> in header.
  • if --base-href x provided and base tag already exists then replace only the "href" attribute of base tag. (In case developer uses additional attribute(s) like "target").

Also I'm thinking that instead of auto-prefixing url with slash whole url should be provided by developer for the case when I want to overwrite my /xxx/ (which already sits in index.html) with just /.

@filipesilva
Copy link
Contributor

I was gonna pick this one up, but if you're working on it I'm happy to help. I'm speaking as myself now, design for this feature hasn't been discussed within the team.

There's a couple of extra things you have to look into when developing this feature:

As far as behavior goes, I think your proposal makes sense. I also agree the developer should provide the whole URL.

dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 29, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 29, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Jul 31, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Aug 9, 2016
Implement --base-href argument for build and serve commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Aug 23, 2016
Implement --base-href argument for build, serve and github-pages:deploy commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Aug 24, 2016
Implement --base-href argument for build and github-pages:deploy commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Aug 25, 2016
Implement --base-href argument for build and github-pages:deploy commands

Closes angular#1064
dzonatan added a commit to dzonatan/angular-cli that referenced this issue Aug 25, 2016
Implement --base-href argument for build and github-pages:deploy commands

Closes angular#1064
@isleshocky77
Copy link

@dzonatan I'm not seeing it anywhere in the commit, but are you able to configure this option in the environment files instead?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) feature Issue that requests a new feature P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants