Skip to content

fix(platform-browser): prepend baseHref to sourceMappingURL in CSS content #59730

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

Closed
wants to merge 3 commits into from

Conversation

alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Jan 27, 2025

Implemented functionality to prepend the baseHref to sourceMappingURL in CSS content. Added handling to ensure external sourcemaps are loaded relative to the baseHref. Corrected sourcemap URL behavior when accessing pages with multi-segment URLs (e.g., /foo/bar). Ensured that when the baseHref is set to /, maps are requested from the correct path (e.g., http://localhost/comp.css.map instead of http://localhost/foo/bar/comp.css.map).

Closes #59729

//cc @clydin

@alan-agius4 alan-agius4 added area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release core: stylesheets labels Jan 27, 2025
@ngbot ngbot bot added this to the Backlog milestone Jan 27, 2025
@alan-agius4 alan-agius4 force-pushed the css-sourcemap-external branch 3 times, most recently from dc9426b to e9d4ffa Compare January 27, 2025 10:02
@alan-agius4 alan-agius4 force-pushed the css-sourcemap-external branch 2 times, most recently from 221552d to 5b7c512 Compare January 27, 2025 10:42

Verified

This commit was signed with the committer’s verified signature.
lforst Luca Forstner
…S content

Implemented functionality to prepend the baseHref to `sourceMappingURL` in CSS content. Added handling to ensure external sourcemaps are loaded relative to the baseHref. Corrected sourcemap URL behavior when accessing pages with multi-segment URLs (e.g., `/foo/bar`). Ensured that when the baseHref is set to `/`, maps are requested from the correct path (e.g., `http://localhost/comp.css.map` instead of `http://localhost/foo/bar/comp.css.map`).

Closes angular#59729
@alan-agius4 alan-agius4 force-pushed the css-sourcemap-external branch from 5b7c512 to 2e90ced Compare January 27, 2025 10:57
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 27, 2025
@alan-agius4 alan-agius4 marked this pull request as ready for review January 27, 2025 11:54
@pullapprove pullapprove bot requested a review from thePunderWoman January 27, 2025 11:54
@alan-agius4 alan-agius4 force-pushed the css-sourcemap-external branch 2 times, most recently from 3bb968f to 2e90ced Compare January 27, 2025 13:04
@alan-agius4 alan-agius4 requested a review from clydin January 27, 2025 14:42

Verified

This commit was signed with the committer’s verified signature.
lforst Luca Forstner
…` in CSS content
@alan-agius4 alan-agius4 force-pushed the css-sourcemap-external branch from 94b920c to 1600d37 Compare January 27, 2025 14:45

Verified

This commit was signed with the committer’s verified signature.
lforst Luca Forstner
…` in CSS content
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 28, 2025
@alxhub
Copy link
Member

alxhub commented Jan 29, 2025

This PR was merged into the repository by commit 6b09716.

The changes were merged into the following branches: main, 19.1.x

@alxhub alxhub closed this in 6b09716 Jan 29, 2025
alxhub pushed a commit that referenced this pull request Jan 29, 2025
…S content (#59730)

Implemented functionality to prepend the baseHref to `sourceMappingURL` in CSS content. Added handling to ensure external sourcemaps are loaded relative to the baseHref. Corrected sourcemap URL behavior when accessing pages with multi-segment URLs (e.g., `/foo/bar`). Ensured that when the baseHref is set to `/`, maps are requested from the correct path (e.g., `http://localhost/comp.css.map` instead of `http://localhost/foo/bar/comp.css.map`).

Closes #59729

PR Close #59730
@alan-agius4 alan-agius4 deleted the css-sourcemap-external branch January 29, 2025 16:48
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…S content (angular#59730)

Implemented functionality to prepend the baseHref to `sourceMappingURL` in CSS content. Added handling to ensure external sourcemaps are loaded relative to the baseHref. Corrected sourcemap URL behavior when accessing pages with multi-segment URLs (e.g., `/foo/bar`). Ensured that when the baseHref is set to `/`, maps are requested from the correct path (e.g., `http://localhost/comp.css.map` instead of `http://localhost/foo/bar/comp.css.map`).

Closes angular#59729

PR Close angular#59730
@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 Mar 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime core: stylesheets target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Components sourcemap not resolved when using sub-paths
5 participants