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

gulp-compass is not working in the gulp's stream paradigm

Open lzl124631x opened this issue 8 years ago • 4 comments

gulp-compass uses the config css and scss to determine the input files and output files, but a more-gulp way should be:

gulp.src('path/to/*.scss')
.pipe(compass({ /* settings other than input and output folder */)
.pipe(gulp.dest('path/to/.css')

I highly recommend gulp-compass change to this paradigm.

lzl124631x avatar Jan 29 '16 06:01 lzl124631x

I posted a question here. @appleboy

lzl124631x avatar Jan 29 '16 07:01 lzl124631x

For xx.scss, there will be a xx.css generated by gulp-compass command. I don't want this file to be generated and prefer to output the xx-what-ever-suffix.css using gulp.dest. Is it possible to turn off the default xx.css file??

lzl124631x avatar Jan 29 '16 14:01 lzl124631x

+1

alexcastillo avatar Feb 02 '16 14:02 alexcastillo

Came across another problem related -- I want to pass in argument (for example, $cdn-domain) that is different across staging and production setting. As gulp-sass doesn't support passing in argument inherently, I have to do preprocessing using gulp-replace or gulp-preprocess to change the setting in sass file. However, since gulp-compass doesn't read the upper-stream, you cannot do any preprocessing. Anyway, you can do postprocessing, but it's ugly, IMHO.

gulp.src('src/sass/*.scss')
        .pipe(replace(/CDN_DOMAIN/g, 'https://cdn.xxx.com')) <--- preprocessing here, but doesn't work
        .pipe(compass({
            css: 'src/css',
            sass: 'src/sass'
        }))
        <-- have to put the processing here. ugly...
        .pipe(cssnano())
        .pipe(gulp.dest('dist/css'));

lzl124631x avatar May 12 '16 09:05 lzl124631x