Skip to content

Commit

Permalink
feat!: remove watchExclude (#5177)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev authored May 9, 2024
1 parent 1532c19 commit d7371ea
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 25 deletions.
10 changes: 1 addition & 9 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,6 @@ inject('wsPort') === 3000
```
:::

### watchExclude<NonProjectOption />

- **Type:** `string[]`
- **Default:** `['**/node_modules/**', '**/dist/**']`
- **Deprecated** use [`server.watch.ignored`](https://vitejs.dev/config/server-options.html#server-watch)

Glob pattern of file paths to be ignored from triggering watch rerun.

### forceRerunTriggers<NonProjectOption />

- **Type**: `string[]`
Expand All @@ -1061,7 +1053,7 @@ test('execute a script', async () => {
```

::: tip
Make sure that your files are not excluded by `watchExclude`.
Make sure that your files are not excluded by [`server.watch.ignored`](https://vitejs.dev/config/server-options.html#server-watch).
:::

### coverage<NonProjectOption />
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const config = {
testTimeout: 5000,
hookTimeout: 10000,
teardownTimeout: 10000,
watchExclude: ['**/node_modules/**', '**/dist/**'],
forceRerunTriggers: [
'**/package.json/**',
'**/{vitest,vite}.config.*/**',
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/node/cli/cli-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ export const cliOptionsConfig: VitestCLIOptions = {
snapshotFormat: null,
snapshotSerializers: null,
includeSource: null,
watchExclude: null,
alias: null,
env: null,
environmentMatchGlobs: null,
Expand Down
2 changes: 0 additions & 2 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,6 @@ export class Vitest {
if (this.config.forceRerunTriggers.length)
watcher.add(this.config.forceRerunTriggers)

watcher.unwatch(this.config.watchExclude)

watcher.on('change', onChange)
watcher.on('unlink', onUnlink)
watcher.on('add', onAdd)
Expand Down
2 changes: 0 additions & 2 deletions packages/vitest/src/node/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ export class Logger {
this.console.error(c.dim('typecheck exclude: ') + c.yellow(config.typecheck.exclude.join(comma)))
}
})
if (config.watchExclude)
this.console.error(c.dim('watch exclude: ') + c.yellow(config.watchExclude.join(comma)))

if (config.watch && (config.changed || config.related?.length)) {
this.log(`No affected ${config.mode} files found\n`)
Expand Down
3 changes: 0 additions & 3 deletions packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
},
server: {
...testConfig.api,
watch: {
ignored: testConfig.watchExclude,
},
open,
hmr: false,
preTransformRequests: false,
Expand Down
7 changes: 0 additions & 7 deletions packages/vitest/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ export interface InlineConfig {
*/
globalSetup?: string | string[]

/**
* Glob pattern of file paths to be ignore from triggering watch rerun
* @deprecated Use server.watch.ignored instead
*/
watchExclude?: string[]

/**
* Glob patter of file paths that will trigger the whole suite rerun
*
Expand Down Expand Up @@ -938,7 +932,6 @@ export type ProjectConfig = Omit<
| 'poolOptions'
| 'teardownTimeout'
| 'silent'
| 'watchExclude'
| 'forceRerunTriggers'
| 'testNamePattern'
| 'ui'
Expand Down

0 comments on commit d7371ea

Please sign in to comment.