Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom .csscomb.json doesn't work. #19

Open
ghost opened this issue Jul 15, 2015 · 5 comments
Open

Custom .csscomb.json doesn't work. #19

ghost opened this issue Jul 15, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 15, 2015

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.

@kiseln
Copy link

kiseln commented Aug 13, 2015

Same issue. However, it works on 3.0.2.

@wroughtec
Copy link

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

@klierik
Copy link

klierik commented Nov 10, 2015

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

@scoobster17
Copy link

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'  } ))

@Paul-Hume
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants