Skip to content

Commit cc2210c

Browse files
committed
refactor: code
1 parent 8bd0849 commit cc2210c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/Server.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,6 @@ class Server {
447447
const compilerWatchOptions = compilerOptions.watchOptions || {};
448448

449449
const getDefaultWatchOptions = (watchOptions = {}) => {
450-
watchOptions = {
451-
...compilerWatchOptions,
452-
...watchOptions,
453-
};
454450
// duplicate the same massaging of options that watchpack performs
455451
// https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L49
456452
// this isn't an elegant solution, but we'll improve it in the future
@@ -468,17 +464,14 @@ class Server {
468464
: // eslint-disable-next-line no-undefined
469465
undefined;
470466

471-
if (watchOptions.poll) {
472-
delete watchOptions.poll;
473-
}
474-
475-
const finalWatchOptions = {
467+
const { poll, ...finalWatchOptions } = {
476468
ignoreInitial: true,
477469
persistent: true,
478470
followSymlinks: false,
479471
atomic: false,
480472
alwaysStat: true,
481473
ignorePermissionErrors: true,
474+
...compilerWatchOptions,
482475
...watchOptions,
483476
ignored: watchOptions.ignored,
484477
usePolling,

0 commit comments

Comments
 (0)