sprockets-rails
sprockets-rails copied to clipboard
Handline Inline Sourcemaps
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.