Enable Sass comments and run prefixing before minification #2078
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was looking into a fix for #2077 and here’s what I discovered:
cssnano
was not the issue with the above mentioned issue the desired functionality works perfectly when using normal CSS instead of Sass.cssnano
completely still resulted with the same issue./*! autoprefixer: off */
in Sass and Less.The problem:
cssnano
’sdiscardComments
set toremoveAll: true
since we don’t want any comments in the production built code.This pull request:
I do not know the side effects of doing this. I am actively testing for anything undesirable.Everything seems to run fine from my tests. I do know that cssnano doesn’t remove prefixes as of4.0.0-rc.0
, so there should be no issues there.Examples
Before as described in #2077
Input:
Output:
With the important comment and discardComments removed
Input:
Output:
This works but we don’t want the comment in there.
With this PR
Input:
Output:
Perfect!
Related