gulp sourcemaps not writing expected sourcemap

孤街醉人 提交于 2019-12-11 13:46:55

问题


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

The issue is that the source map looks like this:

{"version":3,"sources":["../../stdin"]....

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


回答1:


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.

Source: https://github.com/dlmanning/gulp-sass/issues/394



来源:https://stackoverflow.com/questions/34090352/gulp-sourcemaps-not-writing-expected-sourcemap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!