gulp-csscomb icon indicating copy to clipboard operation
gulp-csscomb copied to clipboard

Custom .csscomb.json doesn't work.

Open ghost opened this issue 10 years ago • 5 comments

I have kept .csscomb.json in the root.

This is the code I have in gulpfile.js which doesn't work:

var gulp = require('gulp'),
sass = require('gulp-sass'),
csscomb = require('gulp-csscomb');

gulp.task('styles', function() {
    gulp.src('assets/sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(csscomb('.csscomb.json'))
    .pipe(gulp.dest('assets/css/'));
});

gulp.task('default', function() {
  // place code for your default task here
  gulp.watch('assets/sass/**/*.scss',['styles']);
});

Niether this works:

var gulp = require('gulp'),
sass = require('gulp-sass'),
csscomb = require('gulp-csscomb');

gulp.task('styles', function() {
    gulp.src('assets/sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(csscomb())
    .pipe(gulp.dest('assets/css/'));
});

gulp.task('default', function() {
  // place code for your default task here
  gulp.watch('assets/sass/**/*.scss',['styles']);
});

Nor this:

var gulp = require('gulp'),
sass = require('gulp-sass'),
csscomb = require('gulp-csscomb');

gulp.task('styles', function() {
    gulp.src('assets/sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(csscomb('./.csscomb.json'))
    .pipe(gulp.dest('assets/css/'));
});

gulp.task('default', function() {
  // place code for your default task here
  gulp.watch('assets/sass/**/*.scss',['styles']);
});

No matter what I do, It applies the default config.

ghost avatar Jul 15 '15 11:07 ghost

Same issue. However, it works on 3.0.2.

kiseln avatar Aug 13 '15 19:08 kiseln

I thought I had the same issue however it turned out my config was not valid (comments threw an error) only worked it out by overwriting the comb in the config in the node module so basically mine was failing silently when in root the error displayed once I had overwritten the default

wroughtec avatar Oct 22 '15 10:10 wroughtec

Have the same issue. I took my default .csscomb.json file that i use in other project (for example with grunt-csscomb) and copy into current project, that based on Gulp. gulp-csscomb do not take my config, it use default instead.

ps: file placement correct — the are in the same folder:

-rw-r--r--   1 klierik  staff    8727 10 ноя 10:32 .csscomb.json
...
-rw-r--r--   1 klierik  staff    7884 10 ноя 10:44 gulpfile.js

pss: "gulp-csscomb": "^3.0.6",

update: problem found — it was syntax error in my .csscomb.json. 3.0.2 version shot error, 3.0.6 — not show error

klierik avatar Nov 10 '15 08:11 klierik

Realise this is an old issue but I'm having this issue even now, but it seems it is only on Windows. Trying the same code from the same repo on a mac works fine.

As @srahulprdxn says, neither of these two options work:

.pipe(csscomb())

or

.pipe(csscomb('./.csscomb.json'))

Looking at the source code I also tried the below to no avail:

.pipe(csscomb( { configPath: './.csscomb.json'  } ))

scoobster17 avatar Oct 15 '16 13:10 scoobster17

To fix this I've rolled back to use 3.0.2 and now all is working fine. This does really need fixing though.

Paul-Hume avatar Feb 24 '17 10:02 Paul-Hume