Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 19, 2021
1 parent 8bd0849 commit cc2210c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/Server.js
Expand Up @@ -447,10 +447,6 @@ class Server {
const compilerWatchOptions = compilerOptions.watchOptions || {};

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

if (watchOptions.poll) {
delete watchOptions.poll;
}

const finalWatchOptions = {
const { poll, ...finalWatchOptions } = {
ignoreInitial: true,
persistent: true,
followSymlinks: false,
atomic: false,
alwaysStat: true,
ignorePermissionErrors: true,
...compilerWatchOptions,
...watchOptions,
ignored: watchOptions.ignored,
usePolling,
Expand Down

0 comments on commit cc2210c

Please sign in to comment.