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

Process source mapping URLs be set by transpilers #479

Merged
merged 6 commits into from
Nov 15, 2021

Conversation

dhh
Copy link
Member

@dhh dhh commented Nov 12, 2021

If you prepare a JavaScript file by a bundler that adds a sourceMappingURL comment line as the last in the file, Sprockets will append a semicolon to this comment, thus breaking the URL reference.

The sourceMappingURL will also reference a file that has not been digested yet.

This PR fixes both issues.

Rewrites source mapping urls with the digested paths and protect against semicolon appending with a dummy comment line.
@dhh
Copy link
Member Author

dhh commented Nov 12, 2021

Reference rails/sprockets#702 for history about this semicolon appending business.

@dhh dhh merged commit d71a2d8 into master Nov 15, 2021
@dhh dhh deleted the lookup-and-protect-existing-source-mapping-urls branch November 15, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant