sassgulpgulp-ruby-sass

Is it possible to have a scss file converted to an expanded and a compressed css file in gulp-ruby-sass?


Is it possible to have a scss file converted to an expanded and compressed css file? What I'd like to have is a bootstrap.scss file saved as boostrap.css and bootstrap.min.css

I currently have the following code that will covert the scss file to a compressed css file that has the same name.

var config = {
sassPath: './static/scss',
bowerDir: './static/bower_components'
};


gulp.task('sass', function(){
   return sass(config.sassPath, {style: 'compressed', loadPath: [
       './static/scss',
       config.bowerDir + '/bootstrap-sass/assets/stylesheets'
   ]})
       .on('error', function(err){
           console.error('Error!', err.message);
       })
       .pipe(gulp.dest('./static/css'));
});

Solution

  • I'm also using gulp-ruby-sass | https://stackoverflow.com/tags/gulp-ruby-sass/info

    gulp.task('app-css', function() {
        return sass('bower_components/sass-smacss/sass/dashboard.scss', {
            // noCache: true,
            style: 'compressed' 
        })
        .pipe(sourcemaps.init())
        .on('error', errorlog)
        .pipe(sourcemaps.write('./maps'))
        .pipe(gulp.dest('app/assets/css/'))
    });
    

    Just replace compressed with expanded above.