-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List plugins inside plugin packs #21
Comments
Yeah this is actually super cool! Looking to add this stuff as well! Here's how I'm thinking I'm going to implement this:
@ben-eb Make sense? |
You could also have a |
That is so much smarter/better, and then if I really wanted to generate that |
Alright, I'll send a patch for cssnano's plugins. 😄 |
I would rather the packs identify which plugins they utilize. This might be inferable from package.json |
I like both of these ideas... so here's what I think is the most comprehensive: {
"name": "cool-plugin-pack",
"tags": [
"pack"
],
"plugins_used": [
"a-neat-plugin",
"other-plugin"
]
},{
"name": "a-neat-plugin",
"tags": [
"fun"
],
"packs": [
"cool-plugin-pack"
]
} (obviously I left out some properties but you get the idea...) |
We can get the other by code, surely? |
@ben-eb how do you mean? I see it being used as such: require("postcss-plugins").forEach(function(plugin){
if( plugin.tags.indexOf("pack") < 0 ){
// this plugin is a pack
// plugin.plugins_used exists and can be iterated through
}else{
if( plugin.packs ){
// this plugin is part of a pack, and plugin.packs can be iterated through
}else{
// this plugin is not a pack or part of a pack
}
}
}); Should there just be like an |
I mean that you can infer the relationship between the pack & each of its plugins without needing two properties, whichever you choose. |
I already started using the |
Related to #13, might we use |
Well we kind of already have the |
It would be good to list plugins as parts of plugin packs. So for example cssnext uses postcss-selector-matches, and at least a handful of plugins use postcss-reporter. Would be great if those connections were realised in this list. 😄
Would be nice also to list some plugins that are not included, once this is done. We decided to remove most of cssnano's plugins (there are a lot now!) from the PostCSS readme on account of the optimisations section being too big.
The text was updated successfully, but these errors were encountered: