From ce03088b81910cbe947258079e9588f0c0fd9437 Mon Sep 17 00:00:00 2001 From: Mike Cebrian Date: Mon, 26 Sep 2016 15:35:30 -0400 Subject: [PATCH] feat(webpackDevServer): Add watchOptions for webpackDevServer (#1814) Add watchOptions to webpackDevServerConfiguration to conditionally enable polling option in watchpack Remove additional blank lines from end of serve-watchpack.ts so that only one is remaining --- packages/angular-cli/lib/config/schema.d.ts | 1 + packages/angular-cli/lib/config/schema.json | 5 ++++- packages/angular-cli/tasks/serve-webpack.ts | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/angular-cli/lib/config/schema.d.ts b/packages/angular-cli/lib/config/schema.d.ts index f660f183f221..bb47f47212a8 100644 --- a/packages/angular-cli/lib/config/schema.d.ts +++ b/packages/angular-cli/lib/config/schema.d.ts @@ -59,5 +59,6 @@ export interface CliConfig { defaults?: { styleExt?: string; prefixInterfaces?: boolean; + poll?: number; }; } diff --git a/packages/angular-cli/lib/config/schema.json b/packages/angular-cli/lib/config/schema.json index af5d76267e71..5077846501e6 100644 --- a/packages/angular-cli/lib/config/schema.json +++ b/packages/angular-cli/lib/config/schema.json @@ -135,10 +135,13 @@ }, "prefixInterfaces": { "type": "boolean" + }, + "poll": { + "type": "number" } }, "additionalProperties": false } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/packages/angular-cli/tasks/serve-webpack.ts b/packages/angular-cli/tasks/serve-webpack.ts index 4dfb1dffff1f..a227220fcc97 100644 --- a/packages/angular-cli/tasks/serve-webpack.ts +++ b/packages/angular-cli/tasks/serve-webpack.ts @@ -54,7 +54,10 @@ export default Task.extend({ historyApiFallback: true, stats: webpackDevServerOutputOptions, inline: true, - proxy: proxyConfig + proxy: proxyConfig, + watchOptions: { + poll: CliConfig.fromProject().config.defaults.poll + } }; ui.writeLine(chalk.green(oneLine`