Skip to content

Commit

Permalink
chore: ignore node_modules for webpack dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Aug 21, 2024
1 parent 31b8610 commit 77b5dee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions npm/webpack-dev-server/src/makeDefaultWebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ export function makeCypressWebpackConfig (
devtool: 'inline-source-map',
} as any

// if experimentalJustInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test
if (isRunMode && !experimentalJustInTimeCompile) {
if (isRunMode) {
// if experimentalJustInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test
const ignored = experimentalJustInTimeCompile ? /node_modules/ : '**/*'

// Disable file watching when executing tests in `run` mode
finalConfig.watchOptions = {
ignored: '**/*',
ignored,
}
}

Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/test/makeWebpackConfig.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ describe('makeWebpackConfig', () => {
}),
})

expect(actual.watchOptions?.ignored).to.be.undefined
expect(actual.watchOptions?.ignored).to.deep.equal(/node_modules/)
})
})
})
Expand Down

0 comments on commit 77b5dee

Please sign in to comment.