Skip to content

using deploy-url and base-href yields in wrong assets path #6730

Description

@schmitch

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.1.1
node: 8.1.1
os: darwin x64

Repro steps.

create a new application and use a --base-href=/ui/ and --deploy-url=/ui/ while having a stylesheet of:

.login-body {
  background: rgba(0, 0, 0, 0) url("/assets/images/bg.png") no-repeat scroll 0 0 / cover;
}

The output will then be .login-body{background:transparent url(/ui/ui/assets/images/bg.png) no-repeat scroll 0 0/cover} in both, build --prod --deploy-url=/ui/ --base-href=/ui/ and on serve --deploy-url=/ui/ --base-href=/ui/

Mention any other details that might be useful.

Actually if I remove one of the things either base-href and deploy-url it would work, however if I omit base-href routing will actually re-initialize the application everytime I open a [href] or ng-href link (hybrid app). if I omit deploy-url i will get 404 well I might make it work without deploy-url since I proxy the ng serve in my application and I can strip the path, but I still think that setting both shouldn't end in a assets path of /ui/ui/.
What's even more strange is that the $icon-font-path and $fa-font-path of font-awesome and boostrap are working correctly and don't double add a /ui/

Basically I think that without --deploy-url I can fully use my application since angular-cli omits relative url's so the script path is ui/.... However it would've been great to use absolute-urls for everything which I can enforce with --deploy-url.

Activity

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

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentseverity3: broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions