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

Breaking change about image paths on beta.16 #2441

Closed
dzonatan opened this issue Sep 30, 2016 · 3 comments
Closed

Breaking change about image paths on beta.16 #2441

dzonatan opened this issue Sep 30, 2016 · 3 comments

Comments

@dzonatan
Copy link
Contributor

dzonatan commented Sep 30, 2016

angular-cli: 1.0.0-beta.16
node: 6.5.0
os: win32 x64

Problem

On <=beta.15 all image paths (<img src="my/path") were resolved as absolute paths from src folder. Even ones without starting slash /. Meaning we could use an existing image in src/assets/image.png like this <img src="assets/image.png"> from anywhere we want.

With beta.16 all image paths starting without slash / are now relative.

Using relative paths like <img src="../../assets/image.png"> are most of the time pain in the ass and makes more sense to use them absolute (<img src="/assets/image.png">).
And there comes the problem when using absolute paths with custom base tag (--base-href /myPath/).
It's obvious that it wont work because path such as /assets/image.png will ignore base tag and directly request app domain.

Actions required

  • Update CHANGELOG.md about this breaking change for ones who were using absolute paths for images without starting /, they should use it now.
  • Support absolute image paths with --base-href option by some webpack plugin which would prefix all image paths with that base url or make it relative (?)
@Bulan
Copy link

Bulan commented Sep 30, 2016

Possible duplicate with #2396

@filipesilva
Copy link
Contributor

Dupe of #2396

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants