You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The options are becoming more and more complex so that the documents describing it are long. Can we make it compatible with postcss-load-config
See: https://github.com/gucong3000/gulp-postcss#readme
gulp.task('css',function(){functioncallback(ctx){return{// Configure parser on per-file-basis.parser: ctx.file.extname==='.sss' ? 'sugarss' : false,// Plugins can be loaded in either using an {Object} or an {Array}.plugins: [autoprefixer,cssnano]};}returngulp.src('./src/*.css',{// Source map supportsourcemaps: true}).pipe(postcss(callback))// Message repport support.pipe(reporter()).pipe(gulp.dest('./dest'));});
In this demo callback function as same as postcss-load-config
I see, this is not about changing the docs, but about changing the api. Can't you achieve the same thing with postcss.config.js, why does it have to be inlined? The idea is to only support postcss-load-config when there are no options passed to gulp-postcss. If the options are passed, then postcss-load-config is not even required.
In our company, we use postcss under webpack, gulp-postcss use for run stylelint and stylefmt.
So, config in postcss.config.js are css build logic, style lint and fix are write in gulpfile.js.
If the two use the same syntax, it can reduce the cost of learning for the project members.
Activity
gucong3000 commentedon Jul 6, 2017
In this demo

callbackfunction as same aspostcss-load-configgucong3000 commentedon Jul 6, 2017
Config in
postcss.config.jsor.postcssrc.js, is not same withgulp-postcssat all.In my fork, they are the same data structures and APIs
gucong3000 commentedon Jul 6, 2017
So that users can learn one of them, do not have to pay twice times the cost of learning
w0rm commentedon Jul 6, 2017
I see, this is not about changing the docs, but about changing the api. Can't you achieve the same thing with
postcss.config.js, why does it have to be inlined? The idea is to only supportpostcss-load-configwhen there are no options passed to gulp-postcss. If the options are passed, thenpostcss-load-configis not even required.gucong3000 commentedon Jul 6, 2017
In our company, we use postcss under
webpack,gulp-postcssuse for runstylelintandstylefmt.So, config in
postcss.config.jsare css build logic, style lint and fix are write ingulpfile.js.If the two use the same syntax, it can reduce the cost of learning for the project members.