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

Ignore inline source maps when minifying CSS files. #10263

Merged
merged 3 commits into from Oct 10, 2018

Conversation

benjamn
Copy link
Contributor

@benjamn benjamn commented Oct 10, 2018

#10112 (comment)

Further down in the mergeCss function, when we call CssTools.stringifyCss, we pass the following option:

// don't try to read the referenced sourcemaps from the input
inputSourcemaps: false

Apparently this isn't enough to avoid reading inline source maps from the input file, so we should be a bit more aggressive about preventing postcss from picking up inline source maps.

This change mostly affects .css files imported from node_modules, and possibly raw .css files in the application that happen to have inline sourceMappingURL= comments. For CSS output from compiler plugins like LESS and SCSS, we have a totally different mechanism of handling source maps, namely file.getSourceMap().

Should fix #10112.

#10112 (comment)

Further down in the mergeCss function, when we call CssTools.stringifyCss,
we pass the following option:

  // don't try to read the referenced sourcemaps from the input
  inputSourcemaps: false

Apparently this isn't enough to avoid reading inline source maps from the
input file, so we should be a bit more aggressive about preventing postcss
from picking up inline source maps.

This change mostly affects .css files imported from node_modules, and
possibly raw .css files in the application that happen to have inline
sourceMappingURL= comments. For CSS output from compiler plugins like LESS
and SCSS, we have a totally different mechanism of handling source maps,
namely file.getSourceMap().

Should fix #10112.
@benjamn benjamn added this to the Package Patches milestone Oct 10, 2018
@benjamn benjamn force-pushed the fix-issue-10112-by-ignoring-inline-source-maps branch from 767daf5 to 3f30d22 Compare October 10, 2018 20:40
@benjamn benjamn merged commit ccb479f into devel Oct 10, 2018
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.

Galaxy minifyStdCSS_plugin cannot read getContentAsString of undefined
1 participant