From 0a3efd4790b6aca58d80bebd492a6824a0f67ad7 Mon Sep 17 00:00:00 2001 From: Tom Sundstrom Date: Tue, 23 Feb 2016 13:58:11 +0200 Subject: [PATCH] feat(serve): Optionally use Webpack's polling watcher https://github.com/driftyco/ionic-cli/issues/759 --- lib/serve.js | 1 + lib/v2/build.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/serve.js b/lib/serve.js index 313715f..4e546e6 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -194,6 +194,7 @@ Serve.loadSettings = function loadSettings(argv, project) { options.browser = options.browser || options.defaultBrowser; options.watchPatterns = project.get('watchPatterns') || ['www/**/*', '!www/lib/**/*']; + options.watchPoll = !!argv['watch-poll']; options.printConsoleLogs = argv.consolelogs || argv['console-logs'] || argv.c; options.printServerLogs = argv.serverlogs || argv['server-logs'] || argv.s; options.isAddressCmd = argv._[0].toLowerCase() == 'address'; diff --git a/lib/v2/build.js b/lib/v2/build.js index 646c2ec..3864c81 100644 --- a/lib/v2/build.js +++ b/lib/v2/build.js @@ -77,7 +77,11 @@ Build.bundle = function(options) { var compiler = webpack(config); if (options.watch) { //TODO expose watch options - compiler.watch(null, compileHandler); + var watchOptions = {}; + if (options.watchPoll) { + watchOptions.poll = true; + } + compiler.watch(watchOptions, compileHandler); } else { compiler.run(compileHandler); }