taskr-outdated icon indicating copy to clipboard operation
taskr-outdated copied to clipboard

[postcss] Add support for common config

Open hzlmn opened this issue 8 years ago • 7 comments

Hey, it's just a reminder for me.

PostCSS currently support common configuration file postcss.config.js It would be nice to add this feature in taskr plugin as well.

PS. I played with labels, feel free to change naming how you like.

hzlmn avatar Jun 20 '17 16:06 hzlmn

Sounds good! I can crank this out real quick, unless you're on it already.

And I edited the label to just be "plugin" for now. Can adapt as the issues come in.

lukeed avatar Jun 20 '17 17:06 lukeed

Man, you are fast :) I am not on it yet, you can take it if you wish, unless you have higher priority tasks.

hzlmn avatar Jun 20 '17 17:06 hzlmn

Haha 😇 I'm getting started for the day! I like to do small OSS fixes to "warm up"

I'll open a PR and await your review since you are the expert here 👍

lukeed avatar Jun 20 '17 17:06 lukeed

So, I think supporting the "postcss" key inside package.json is also a good idea.

What about supporting custom filenames (eg, path/to/config.js) and the unofficial rc-files? (.postcssrc, .postcss.yml, etc)

lukeed avatar Jun 20 '17 18:06 lukeed

These options would look like:

// autoload `postcss.config.js` 
// or "postcss" key in `package.json`
yield task.source(...).postcss().target(...);

// specify a custom config
yield task.source(...).postcss('path/to/config.js').target(...);
yield task.source(...).postcss({ config: 'path/to/config.js' }).target(...);

// send options (current)
yield task.source(...).postcss({ plugins:[], options:{} }).target(...);

I am unsure about the custom configs (2 & 3).

lukeed avatar Jun 20 '17 18:06 lukeed

postcss ecosystem has common way for doing this - postcss-load-config . If you don't want to add it as dependency i guess that options described in readme should be supported.

hzlmn avatar Jun 20 '17 19:06 hzlmn

Right, I just saw that too. I checked it out & it has a lot of dependencies that mimics what we already have built-in.

Sending a PR now. Tests to follow later

lukeed avatar Jun 20 '17 20:06 lukeed