Ignore comment doesnt work for importing css into sass
See original GitHub issueDescribe the bug First of all, i love your plugin. It works really good. After working with some libraries like ‘leaflet’ that has pure css or some libraries using less and compiled css, i found issue while importing those styles into project. It remove whole styles.
I am using webpack with sass-loader, postcss (autoprefix) and MiniCssExtractPlugin. I tryed using whitelisting and others stuff (even thought its not nice to whitelist all possible libraries like that), that works in development. But in production whitelisting doesn’t works either. Even turned off removing comments from node-sass, but then all i could see is only comments for ignoring import css and empty content.
/* purgecss ignore */
@import "~leaflet/dist/leaflet.css";
or
/* purgecss start ignore */
@import "~leaflet/dist/leaflet.css";
/* purgecss end ignore */
even tryed to importing in separate file and ignore importing sass file.
/* purgecss start ignore */
@import "leaflet";
/* purgecss end ignore */
Nothing works. All i can think of is concat after purging my main file.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:20
- Comments:20
add ! after /*
These works on webpack 4
I read on cssnano docs how to preserve the comments https://cssnano.co/optimisations/discardcomments/
Had the same issue, tried various proposed solutions and in the end removing the
.css
is what helped solve it