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

Autoload PostCSS configs

Open lukeed opened this issue 8 years ago • 1 comments

When no options are passed, the @taskr/postcss plugin will now look for & respect configs found within: ~(arranged by preference):~

  • a .postcssrc file (JSON-type only)
  • the "postcss" key inside package.json
  • a postcss.config.js file (Object or Function type)
  • a .postcssrc.js file (Object or Function type)

As for usage, all options are available:

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

// run autoload checks (any of above)
yield task.source(...).postcss().target(...);

An error will be emitted, forcing the plugin to stop, if the final/parsed options is not an Object.

~TODO: Add autoload-config tests.~

Closes #4

lukeed avatar Jun 20 '17 20:06 lukeed

@hzlmn PostCSS has way more config-combinations than I initially anticipated, lol. Definitely took more time than I expected to, too 😅 80 LOC for just options-handling

Check it out, and let me know if it works for you. Once you approve, I'll cut this as 1.1.0.

lukeed avatar Jun 21 '17 08:06 lukeed