Cannot use `cssnano` in version 7
Here is a reproduction. Note that this is a branch in the repo, the master branch is for a different issue.
Using cssnano doesn't work at all with ember-cli-postcss version 7. It seems to pass the plugins defined in the filter block in ember-cli-build as plugins to cssnano (which I guess has some plugin mechanism) and that breaks badly as it expects completely different things.
To reproduce - clone the repo, checkout the branch, npm install, ember serve.
Is it possible to set the plugins for cssnano to an empty array?
filter: {
enabled: true,
plugins: [
{ module: require('autoprefixer') },
{
module: require('cssnano'),
options: { plugins: [] }
},
],
},
@jeffjewiss - indeed, that does fix the issue! However, this is a workaround and not a real fix so let's keep the issue open until it's fixed. Thank you! :)
Glad to hear that fixed it. I think it's because we're merging the options recursively, but I'm not sure when I'll have a chance to work on a fix.
Spoke too soon. That makes the error go away but for some reason cssnano does nothing. That is, the produced CSS is the same with or without adding the cssnano module. That wasn't the case with ember-cli-postcss v6. Any ideas (apart from fixing the bug in ember-cli-postcss)? :smile:
I ran into this and options: { preset: 'default' } fixed it for me.
@gitKrystan thanks for sharing a working config.
I'm going to close this out since that config should solve the issue.