From b2694baf6aa7c4096b68ed01bc19d14bf7559d6f Mon Sep 17 00:00:00 2001 From: wszerad Date: Mon, 11 Apr 2016 14:36:06 +0200 Subject: [PATCH] native watch --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0753b9f..00c24dd 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,8 @@ var through = require('through2'); var path = require('path'); var chokidar = require('chokidar'); +var fs = require('fs'); +var watchProvider = chokidar; var xtend = require('xtend'); var anymatch = require('anymatch'); @@ -19,6 +21,9 @@ function watchify (b, opts) { var updating = false; var wopts = {persistent: true}; + if (opts.nativeWatch) { + watchProvider = fs; + } if (opts.ignoreWatch) { var ignored = opts.ignoreWatch !== true ? opts.ignoreWatch @@ -158,7 +163,7 @@ function watchify (b, opts) { }; b._watcher = function (file, opts) { - return chokidar.watch(file, opts); + return watchProvider.watch(file, opts); }; return b;