Skip to content
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

Autoload PostCSS config #284

Merged
merged 10 commits into from Jul 27, 2017
Merged

Autoload PostCSS config #284

merged 10 commits into from Jul 27, 2017

Conversation

lukeed
Copy link
Owner

@lukeed lukeed commented Jun 25, 2017

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 #283

@lukeed lukeed requested a review from hzlmn June 26, 2017 16:53
Copy link
Collaborator

@hzlmn hzlmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine to me. Sorry for late response 👾

@lukeed
Copy link
Owner Author

lukeed commented Jul 4, 2017

Thanks @hzlmn! Were you able to actually try it out locally, or are you just eyeballing it 👀 😜

@hzlmn
Copy link
Collaborator

hzlmn commented Jul 4, 2017

Both, also I checked it locally with current project, everything works fine. Probably, can just manually test all common configurations... as addition

@lukeed
Copy link
Owner Author

lukeed commented Jul 4, 2017

No need to do extra checks, unless you really want to. 😄

@hzlmn
Copy link
Collaborator

hzlmn commented Jul 4, 2017

Are there any blockers to merge it? 🤓

@lukeed
Copy link
Owner Author

lukeed commented Jul 4, 2017

Nope! Going to make some other package changes tonight before pushing a 1.1.0

@lukeed lukeed added the plugin label Jul 26, 2017
@lukeed lukeed merged commit 141d302 into master Jul 27, 2017
@lukeed lukeed deleted the postcss-config branch July 27, 2017 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants