Skip to content

Commit d7371ea

Browse files
authoredMay 9, 2024··
feat!: remove watchExclude (#5177)
1 parent 1532c19 commit d7371ea

File tree

7 files changed

+1
-25
lines changed

7 files changed

+1
-25
lines changed
 

‎docs/config/index.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -1036,14 +1036,6 @@ inject('wsPort') === 3000
10361036
```
10371037
:::
10381038

1039-
### watchExclude<NonProjectOption />
1040-
1041-
- **Type:** `string[]`
1042-
- **Default:** `['**/node_modules/**', '**/dist/**']`
1043-
- **Deprecated** use [`server.watch.ignored`](https://vitejs.dev/config/server-options.html#server-watch)
1044-
1045-
Glob pattern of file paths to be ignored from triggering watch rerun.
1046-
10471039
### forceRerunTriggers<NonProjectOption />
10481040

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

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

10671059
### coverage<NonProjectOption />

‎packages/vitest/src/defaults.ts

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const config = {
7676
testTimeout: 5000,
7777
hookTimeout: 10000,
7878
teardownTimeout: 10000,
79-
watchExclude: ['**/node_modules/**', '**/dist/**'],
8079
forceRerunTriggers: [
8180
'**/package.json/**',
8281
'**/{vitest,vite}.config.*/**',

‎packages/vitest/src/node/cli/cli-config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ export const cliOptionsConfig: VitestCLIOptions = {
615615
snapshotFormat: null,
616616
snapshotSerializers: null,
617617
includeSource: null,
618-
watchExclude: null,
619618
alias: null,
620619
env: null,
621620
environmentMatchGlobs: null,

‎packages/vitest/src/node/core.ts

-2
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,6 @@ export class Vitest {
810810
if (this.config.forceRerunTriggers.length)
811811
watcher.add(this.config.forceRerunTriggers)
812812

813-
watcher.unwatch(this.config.watchExclude)
814-
815813
watcher.on('change', onChange)
816814
watcher.on('unlink', onUnlink)
817815
watcher.on('add', onAdd)

‎packages/vitest/src/node/logger.ts

-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ export class Logger {
135135
this.console.error(c.dim('typecheck exclude: ') + c.yellow(config.typecheck.exclude.join(comma)))
136136
}
137137
})
138-
if (config.watchExclude)
139-
this.console.error(c.dim('watch exclude: ') + c.yellow(config.watchExclude.join(comma)))
140138

141139
if (config.watch && (config.changed || config.related?.length)) {
142140
this.log(`No affected ${config.mode} files found\n`)

‎packages/vitest/src/node/plugins/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
8080
},
8181
server: {
8282
...testConfig.api,
83-
watch: {
84-
ignored: testConfig.watchExclude,
85-
},
8683
open,
8784
hmr: false,
8885
preTransformRequests: false,

‎packages/vitest/src/types/config.ts

-7
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,6 @@ export interface InlineConfig {
443443
*/
444444
globalSetup?: string | string[]
445445

446-
/**
447-
* Glob pattern of file paths to be ignore from triggering watch rerun
448-
* @deprecated Use server.watch.ignored instead
449-
*/
450-
watchExclude?: string[]
451-
452446
/**
453447
* Glob patter of file paths that will trigger the whole suite rerun
454448
*
@@ -938,7 +932,6 @@ export type ProjectConfig = Omit<
938932
| 'poolOptions'
939933
| 'teardownTimeout'
940934
| 'silent'
941-
| 'watchExclude'
942935
| 'forceRerunTriggers'
943936
| 'testNamePattern'
944937
| 'ui'

0 commit comments

Comments
 (0)
Please sign in to comment.