【发布时间】:2019-04-23 14:00:53
【问题描述】:
我正在使用 Gulp 设置,它将监视我的 HTML、Sass 和文件。下面的错误如何解决?
无法获取/
这是我的代码:
//Watch Files
htmlWatchFiles = './src/html/main/*.html';
//Input files
// File for gulp-sass compiler
var inputScssFile = './src/stylesheets/**/*.scss'
function sassCompiler() {
return gulp.src(inputScssFile)
.pipe(sass())
.pipe(autoPrefixer())
.pipe(dest('./src/stylesheets/output'))
.pipe(browserSync.stream());
}
这是我要观看的功能:
function toBrowseSync(){
browserSync.init({
server: {
baseDir: "src/",
index:"./src/html/main/index/html"
}
});
gulp.watch(inputScssFile,sassCompiler);
gulp.watch(htmlWatchFiles).on('change', browserSync.reload);
}
exports.default = series(sassCompiler,toBrowseSync);
【问题讨论】:
-
@StephenS 干得好)
-
@StephenS,现在你能帮忙解决一下吗?
-
你试过了吗?看起来同样的问题:stackoverflow.com/questions/49686538/…
标签: gulp gulp-watch gulp-sass