生成了不需要的.map文件

时间:2015-04-01 07:56:18

标签: gulp

var gulp =require('gulp'),
    sass = require('gulp-ruby-sass')
    minifycss = require('gulp-minify-css'),
    sourcemaps = require('gulp-sourcemaps'),
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    imagemin = require('gulp-imagemin'),
    rename = require('gulp-rename'),
    concat = require('gulp-concat'),
    notify = require('gulp-notify'),
    cache = require('gulp-cache'),
    livereload = require('gulp-livereload'),
    autoprefixer = require('gulp-autoprefixer'),
    del = require('del');

gulp.task('styles', function() {
  return gulp.src('./public/styles/sass/*.sass')
    .pipe(sass())
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
    .pipe(gulp.dest('./public/styles/css/'))
});

我不希望生成.map文件。我尝试过:{sourcemap:false}但没有任何效果。还有消息说:gulp-ruby-sass:stderr:DEPRECATION WARNING:Passing

--sourcemap without a value is deprecated.
Sourcemaps are now generated by default, so this flag has no effect.

有没有办法阻止生成.map文件?

1 个答案:

答案 0 :(得分:1)

将您的gulp-ruby-sass更新为1.0版并更改代码:

gulp.task('styles', function() {
   return sass('./public/styles/sass/*.sass')
       .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
       .pipe(gulp.dest('./public/styles/css/'))
});