csscomb / csscomb.js

CSS coding style formatter
http://csscomb.com/
MIT License
3.29k stars 458 forks source link

Please help me with gulpfile.js for csscomb #556

Closed Alecto closed 5 years ago

Alecto commented 6 years ago

i use next code

var gulp             = require('gulp');
var csscomb = require('csscomb');
var srcSCSS = 'assets/scss/';

gulp.task('comb', function() {
  return gulp.src([
    srcSCSS         + '**/*.scss',
    '!' + srcSCSS   + 'bourbon/**/*',
    '!' + srcSCSS   + 'neat/**/*'
  ])
    .pipe(csscomb())
    .pipe(gulp.dest(srcSCSS));
});

(the example was taken somewhere in these tickets)

but an error always appears.

D:\Temp\www\root>gulp comb
[18:22:41] Using gulpfile D:\Temp\www\root\gulpfile.js
[18:22:41] Starting 'comb'...
[18:22:41] 'comb' errored after 21 ms
[18:22:41] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (D:\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:516:8)
    at Gulp.<anonymous> (D:\Temp\www\root\gulpfile.js:29:6)
    at module.exports (D:\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (D:\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (D:\node_modules\orchestrator\index.js:134:8)
    at C:\Users\fomen\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^3.7.0\index.js:54:20
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)

help please configure gulp file.

fabiandarga commented 6 years ago

Use gulp-csscomb. Normal csscomb can not be used for the gulp .pipe()

https://www.npmjs.com/package/gulp-csscomb