gulp-compass
gulp-compass copied to clipboard
gulp-compass is not working in the gulp's stream paradigm
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.
I posted a question here. @appleboy
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??
+1
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'));