咕嘟咕嘟咕嘟watch in g g g g c c c c issue [英] gulp-watch in combination with gulp-less caching issue

查看:143
本文介绍了咕嘟咕嘟咕嘟watch in g g g g c c c c issue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:

  //观察变化
gulp.task('watch',函数(){
gulp.watch('./ assets / ** / *。less',['compile-less']);
});

gulp.task(compile-less,()=> {
return gulp.src('./ assets / build-packages / *。less')
.pipe($。less({
paths:[$ .path.join(__ dirname,'less','includes')]
}))
.pipe(gulp.dest (OutputPath)); // ./dist/styles/
});因此,基本上每当开发人员以较少的文件改变某些内容时,它就会执行无编译任务, 。 无编译任务构建我们的少包文件(包括所有@imports)。随机少文件中的第一次更改可以工作,所有正在构建的文件越少。第二次运行任务,但是当我将某些内容更改为导入的较少文件时,我的生成的dist文件夹不会更新。我想知道是否监视任务和编译任务的组合缓存文件。因为如果我手动运行无编译任务,它每次都可以运行。



任何人都有相同的体验?

解决方案

gulp-less 版本4.0.0有一个奇怪的缓存问题。
安装 gulp-less@3.5.0 并解决问题。
这将被修复。请查看 https://github.com/stevelacy/gulp-少/问题/ 283#ref-issue-306992692


I have the following setup:

// watch for changes
gulp.task('watch', function () {
  gulp.watch('./assets/**/*.less', ['compile-less']);
});

gulp.task("compile-less", () => {
    return gulp.src('./assets/build-packages/*.less')
    .pipe($.less({
        paths: [ $.path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(gulp.dest(OutputPath)); // ./dist/styles/
});

So basically every time a developer changes something in a less file it runs the task 'compile-less'. The task 'compile-less' builds our package less files (including all the @imports). The first change in a random less file works, all the less files are being build. The second time it runs the task but my generated dist folder isn't updated when I change something to a less file that is imported. I'm wondering if the combination of the watch task and the compiling task somehow caches files. Because if I run the compile-less task manually it works everytime.

Does anyone had the same experience?

解决方案

gulp-less version 4.0.0 has a strange caching issue. Install gulp-less@3.5.0 and will solve the issue. This will be fixed. Check out https://github.com/stevelacy/gulp-less/issues/283#ref-issue-306992692

这篇关于咕嘟咕嘟咕嘟watch in g g g g c c c c issue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆