rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
Add possibility to pass cssnano options when using extract
Hey,
In cssnano there are presets which can be used - https://cssnano.co/guides/presets.
I wanted to use them and tried the following config, but it didn't work.
postcss({
extract: true,
modules: true,
namedExports: true,
minimize: {
preset: ['default', {
discardComments: {
removeAll: true
}
}]
}
})
It seems like when extract
is true
, options are not passed to cssnano. When not extracted, options are passed.
It would be great have this in extract
mode too.
rollup - 1.2.2 rollup-plugin-postcss - 2.0.3
Just my two cents, but I think cssnano should be removed altogether and developers can just add it to their rollup build as needed. It's super simple to add it as a dependency for your project, and then you can use it according to their docs rather than integrating through this module. Further, upgrading cssnano is then separated from this module.
@enure postcss with modules has all class names, used in files. They can be passed to cssnano and unused classes will be removed from extracted css file. I'm not sure if this is possible with a standalone plugin.
Gotcha, that makes sense.
This is a complete blocker for us right now as we need to extract the css but svgo is trying to compile our already compiled datauri encoded svgs and throwing an error.
rollup - 1.7.0 rollup-plugin-postcss - 2.0.3
This seems to work now? I think this can be closed perhaps?