Skip to content

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

Closed

Description

@timlevett

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

Activity

  1. added
    featureLabel used to distinguish feature request from other issues
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jun 18, 2016
  2. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    and removed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jul 28, 2016
  3. added a commit that references this issue on Jul 29, 2016
    9ab6587
  4. dzonatan commented on Jul 29, 2016

    @dzonatan
    Contributor

    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 /.

  5. filipesilva commented on Jul 29, 2016

    @filipesilva
    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.

  6. added 11 commits that reference this issue on Jul 29, 2016
    26f5d98
    2bf62f1
    f3f101b
    95353cc
    a58458e
    4723ea4
    a89cde0
    87fcc88
    cf94397
    ea99974
    f9e08c7
  7. added a commit that references this issue on Aug 9, 2016
    b216b06
  8. added 4 commits that reference this issue on Aug 23, 2016
    35413c6
    8dd2cfe
    d494f64
    e6dc4c9
  9. added a commit that references this issue on Aug 26, 2016
    74b29b3
  10. isleshocky77 commented on Nov 28, 2016

    @isleshocky77

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

  11. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  12. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfuleffort1: easy (hours)featureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions