Skip to content

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.

dhh added 2 commits November 12, 2021 16:04
Rewrites source mapping urls with the digested paths and protect against semicolon appending with a dummy comment line.
@dhh dhh requested a review from rafaelfranca November 12, 2021 15:08
@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