我正在构建一个Gulp启动器,我想将gulp-resolve-url与gulp-clean-css的相对路径匹配,后者似乎是缩小CSS的最佳gulp插件。
这是我的SCSS任务:
gulp.task('scss', () => {
return gulp.src('src/scss/master.scss')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(gulpResolveUrl())
.pipe(cleancss({ compatibility: 'ie8' }))
.pipe(rename('master.min.css'))
.pipe(gulp.dest('public/css'))
.pipe(browserSync.stream());
});
我遇到这个错误:
SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.
(适用于gulp-cssmin)