egoist / egoist/rollup-plugin-postcss

Add possibility to pass cssnano options when using extract

Open
#159 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

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.

```js
postcss({
extract: true,
modules: true,
namedExports: true,
minimize: {
preset: ['default', {
discardComments: {
removeAll: true
}
}]
}
})
```

It seems like when `extract` is `true`, options [are not passed](https://github.com/egoist/rollup-plugin-postcss/blob/v2.0.3/src/index.js#L175) to cssnano. When not extracted, options [are passed](https://github.com/egoist/rollup-plugin-postcss/blob/v2.0.3/src/postcss-loader.js#L101).

It would be great have this in `extract` mode too.

rollup - 1.2.2
rollup-plugin-postcss - 2.0.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.