【发布时间】:2016-11-04 00:07:18
【问题描述】:
我是 gulp 插件的新手,正在尝试让 sourcemaps 工作
文件结构
css/
sass/
theme/
_some-style.scss
_some-style-2.scss
_some-style-3.scss
style.scss
style.css
style.css.map
在我的 style.scss 文件中有
@import "theme/some-style";
@import "theme/some-style-2";
@import "theme/some-style-3";
太好了,所以当我检查时,我只会在我的开发工具中出现 _some-style-3.scss。我知道我在这里遇到了路径问题,但不知道如何解决。
Gulp 文件:
gulp.task('sass', function () {
return gulp.src(css/sass/theme/**/*.scss)
.pipe(sourcemaps.init())
.pipe(sass.sync().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(css));
});
【问题讨论】: