Angular-cli: Empty string as base href argument

Created on 19 Jul 2017  路  4Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

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

Versions.

1.0.3
(I checked the change log for newer versions but there is no reference to this particular issue, as far as I can see)

Repro steps.

When using the --base-href argument, it does not seem to be possible to use an empty string, as it keeps the old base href (the one set in index.html) instead of overriding it with empty string.

I am using the following command :
ng build --watch --output-hashing=none --base-href='' --output-path=[...]
but the base-href is not working as intended.

help wanted 2 (required) broken bufix

Most helpful comment

Sure is!

All 4 comments

This is a bug in https://github.com/angular/angular-cli/blob/master/packages/@angular/cli/lib/base-href-webpack/base-href-webpack-plugin.ts#L10.

We do if (!this.options.baseHref) { and since !'' is also evaluated to false, the plugin does nothing.

Would you be interested in making a PR that fixes this behaviour?

@filipesilva is this up for grab?

Sure is!

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

Was this page helpful?
0 / 5 - 0 ratings