From c1c8055bacfeea6a14f24bd38993b439c7c2ef09 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Sat, 27 Mar 2021 03:00:57 +0800 Subject: [PATCH] Add docs explaining how to pass options when using postcss.config.js. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 8344b75..7ccc532 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,21 @@ gulp.task('default', function () { }); ``` +If you are using a `postcss.config.js` file, you can pass PostCSS options as the first argument to gulp-postcss. + +This, for instance, will let PostCSS know what the final file destination path is, since it will be unaware of the path given to `gulp.dest()`: + +```js +var gulp = require('gulp'); +var postcss = require('gulp-postcss'); + +gulp.task('default', function () { + return gulp.src('in.scss') + .pipe(postcss({ to: 'out/in.css' })) + .pipe(gulp.dest('out')); +}); +``` + ## Using a custom processor ```js