gulp sourcemaps不能编写预期的源代码 [英] gulp sourcemaps not writing expected sourcemap
问题描述
以下是任务:
Here is the task:
dev.assets.sass = [
'client/modules/*[!public]*/scss/*.scss'
];
gulp.task('sass', function () {
gulp.src(dev.assets.sass)
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(concat('application.min.css'))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./client/build'));
});
问题是源图如下所示:
{"version":3,"sources":["../../stdin"]....
这不是我所期望的。我想要一些类似bootstrap的东西,在Chrome开发者中,一种风格被映射回原来的较少源代码。我的源代码映射回stdin,我认为这是sass管道的结果。我认为gulp-sourcemaps只是为最后一个操作创建映射...
which is not what I expected. I would like something similar to bootstrap, where, in the chrome developer a style is mapped back to its original less source. My sourcemaps are just mapping back to stdin which I assume is the result of the sass pipe. I think gulp-sourcemaps is only creating the map for the last operation...
推荐答案
您需要更新 gulp-sass
到版本 2.1.1 。这是 gulp-sass
中的一个错误,该错误已在最新版本中修复。
You need to update gulp-sass
to version 2.1.1. This was a bug in gulp-sass
that was fixed with the latest release.
来源: https://github.com/dlmanning/gulp-sass/issues/394
这篇关于gulp sourcemaps不能编写预期的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!