gpt4 book ai didi

gulp - 从 gulp-watch 抛出类型错误中排除子目录

转载 作者:行者123 更新时间:2023-12-04 17:33:45 24 4
gpt4 key购买 nike

我正在运行以下监视任务:

gulp.task('watch', function() {

gulp.watch('./ui/scss/*.scss', ['styles']);
gulp.watch('./js/*.js', '!./js/vendor/*.js', ['scripts']);
gulp.watch('./**/*.html', ['html']);

});

但似乎抛出以下错误?...
TypeError: Cannot assign to read only property 'mark' of !./js/vendor/*.js at new Gaze

最佳答案

如果要指定多个路径,则需要在路径周围加上括号。为您的第二只 watch 尝试以下操作:

gulp.watch(['./js/*.js', '!./js/vendor/*.js'], ['scripts']);
gulp.watch处理文件参数与 vinyl-fs 相同.因此,您可以使用 gulp.watch 中的文档中指定的所有功能。以及。

关于gulp - 从 gulp-watch 抛出类型错误中排除子目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32022819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com