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

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

Open
lzl124631x opened this issue Jan 29, 2016 · 4 comments
Open

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

lzl124631x opened this issue Jan 29, 2016 · 4 comments

Comments

@lzl124631x
Copy link

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
Copy link
Author

I posted a question here. @appleboy

@lzl124631x
Copy link
Author

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??

@alexcastillo
Copy link

+1

@lzl124631x
Copy link
Author

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

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

2 participants