【问题标题】:Is it possible to have a scss file converted to an expanded and a compressed css file in gulp-ruby-sass?是否可以在 gulp-ruby-sass 中将 scss 文件转换为扩展和压缩的 css 文件?
【发布时间】:2015-07-16 16:38:41
【问题描述】:

是否可以将 scss 文件转换为扩展和压缩的 css 文件?我想要的是一个 bootstrap.scss 文件,保存为 boostrap.css 和 bootstrap.min.css

我目前有以下代码,可以将 scss 文件转换为具有相同名称的压缩 css 文件。

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

【问题讨论】:

    标签: sass gulp gulp-ruby-sass


    【解决方案1】:

    我也在使用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/'))
    });
    

    只需将compressed 替换为上面的expanded

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-12
      • 1970-01-01
      • 1970-01-01
      • 2016-03-05
      • 1970-01-01
      • 2023-03-17
      • 2014-12-17
      相关资源
      最近更新 更多