gulp-postcss: Unable to use cssnext as a processor with gulp-postcss
I’d like to use the cssnext plugin pack with gulp-postcss, as my first processor to be followed by a set of other cherry picked postcss plugins. The trouble is that I can’t figure out how to get cssnext working with gulp-postcss. In the following code snippet I think I’m using cssnext()
wrong within the processors
array, but everything I’ve tried to correct it fails.
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var cssnext = require('cssnext');
config = {
cssDistPath: './dist/css',
cssSrcGlob: './src/css/**/*.css'
};
gulp.task('css', function () {
var processors = [
cssnext({
features: {
calc: {
preserve: true
}
}
})
];
return gulp.src(config.cssSrcGlob)
.pipe(postcss(processors))
.pipe(gulp.dest(config.cssDistPath));
});
Do you have any suggestions on how to get this working, or a better configuration?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 23 (14 by maintainers)
Commits related to this issue
- #26 fix for object plugins — committed to postcss/gulp-postcss by w0rm 9 years ago
- #26 update version — committed to postcss/gulp-postcss by w0rm 9 years ago
I will take a look at this tonight