-
-
Notifications
You must be signed in to change notification settings - Fork 188
Clearly show what cssnext includes (autoprefixer, cssnano...) #180
Comments
This is question about perfomance or we have some big issue? I think to wait for other plugin packs to understand how people use packs. But I can force this task if we have bigger problem. |
It's not a perf issue, more a usage one. It's useless to add some plugins twice. |
Yeap, |
@MoOx I've pretty much written it already, it is a core module inside cssnano. I could expand some of the logic, use the warnings API and extract it into a separate module if you like. |
Good idea. Please take in mind that I would like to be able to customize the message a little bit so I can produce something like
|
In your case I understand the idea to do that silently for some, but it does make sense to warn for most use cases. |
I can make silent an off by default option. We could do some customisable string substitution, like |
Yeah. Or more something like a template string (it's es6 below with template string + fat arrow function + destructuring for parameter) postcss(require("postcss-detect-duplicate-plugins")({
warningTemplate: ({pluginName}) => `You are using ${pluginName} more than once, which is unnecessary`
}) ES 5 version postcss(require("postcss-detect-duplicate-plugins")({
warningTemplate: function(params) {
return "You are using " + params.pluginName + " more than once, which is unnecessary"
}
}) |
What about this:
And I like the name |
lgtm except |
Would |
Why not. I like long name. I should code in Java. |
@MoOx When warning the user, should we disable the affected plugin too? |
Why not, but I would prefer that user disable duplicate usage :) |
Whichever you prefer, it's your use case. 😄 |
Not relevant since postcss-cssnext now do not handle things that it should not (like import, cssnano etc). |
So, to be clear:
|
postcss-cssnext is now just a collection of plugin and (except autoprefixer) there is no common plugin used with cssnano. Like you said, old options that are not on the "usage" page have been removed. That's why there is a migration guide. |
& postcss-calc. 😄 |
I am tired of notifying people about duplicate use + missuse of cssnext as a plugin. Ref https://github.com/eggsdesign/egg-incubator/issues/1
And #175 will not help, especially if people add autoprefixer after.
We should add something in the doc + automate some warnings. Ref postcss/postcss#325 poke @ai @ben-eb
The text was updated successfully, but these errors were encountered: