sprockets-rails icon indicating copy to clipboard operation
sprockets-rails copied to clipboard

Handline Inline Sourcemaps

Open nicklozon opened this issue 1 year ago • 0 comments

Description

Sprockets gem appends semicolons to each js asset which corrupts //# sourceMappingURL= magic comments. sprockets-rails fixes this by appending \n//!\n to the asset so the sourceMappingURL is not the last line and in turn not corrupted by the semicolon. This only applies to external sourcemap files.

This PR improves SourcemappingUrlProcessor to also add \n//!\n after sourceMappingURL comments when they contain inline sourcemaps.

nicklozon avatar Feb 21 '24 22:02 nicklozon