27
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gulp watchコマンドでファイル追加を検知しない場合の対処方

Last updated at Posted at 2015-02-07

これまでgulp-watchプラグインを使っているもりで、こんなタスクを書いていました。

var watch = require("gulp-watch");

gulp.task("watch", function () {
    gulp.watch(["./css/**", "./js/**"], "task_name");
});

これをgulp watchで監視させていました。
しかし、gulp-watchプラグインを使っているもりで、使っていなかったのが原因でした。

gulp.watch機能はgulpの機能

正しくは

var watch = require("gulp-watch");

gulp.task("watch", function () {
    watch(["./css/**", "./js/**"], function(event){
        gulp.start("task_name");
    });
});

これで実行!

$ gulp watch

動く!

27
31
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?