Closed ai closed 8 years ago
yep, the question is if it's not better to 'enforce' one format, since using a function as config is now possible ?
Yeap, I think one format is better, than multiple. It is easy to show one format in docs, rather than "use this format for this case, and that format for different".
i will try
modules.exports = {
parser: ...,
plugins: [
require('postcss-plugin')
]
}
simply 'passthrough' the array, but it's a potential error pit, if to fragile I leave it for now, anything should be possible with 'standard formatted' config()/config
by now :)
Array in JS syntax and object in package.js on and JSON config? Looks good.
config.plugins can be an {Object} or an {Array} in JS, .postcssrc
(JSON) is an standard format {Object} only during the lack of require()
, the array will be checked if plugins are required
and returned
When finished is ping you and you can finally approve it before npm publish ? :)
@michael-ciniawsky we had some problem with array. I will retest it, when you ping me with 1.0 pre-release.
Sure, ping me before release.
:+1: yep maybe leave it enterily abd curently postcss-load-config v1.0.0-alpha4
there is no array support 😛
Using an Array works know, this should resolve the issue requiring a local plugin (develop, testing) aswell.
module.exports = (ctx) => {
return {
parser: 'sugarss',
plugins: [
require('./postcss-dev')(ctx.dev)
]
}
}
@michael-ciniawsky I saw that you updated examples. They become much better.
Few extra changes, that I suggest:
@ai 👍
We need to add examples, how to set custom plugins in config. Like
./my-plugin
.This config doesn’t work:
This config doesn’t work too: