Skip to content

Commit

Permalink
feat(webpackDevServer): Add watchOptions for webpackDevServer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JSMike authored and Michael Cebrian committed Sep 1, 2016
1 parent 440d767 commit 369f016
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addon/ng2/custom-typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IWebpackDevServerConfigurationOptions {
filename?: string;
watchOptions?: {
aggregateTimeout?: number;
poll?: number;
poll?: number | boolean;
};
publicPath?: string;
headers?: { [key: string]: string };
Expand Down
5 changes: 4 additions & 1 deletion addon/ng2/tasks/serve-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions lib/config/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ export interface CliConfig {
defaults?: {
styleExt?: string;
prefixInterfaces?: boolean;
poll?: number;
};
}
5 changes: 4 additions & 1 deletion lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@
},
"prefixInterfaces": {
"type": "boolean"
},
"poll": {
"type": "number"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
}

0 comments on commit 369f016

Please sign in to comment.