File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,13 @@ const cachedFsUtilsMap = new WeakMap<ResolvedConfig, FsUtils>()
45
45
export function getFsUtils ( config : ResolvedConfig ) : FsUtils {
46
46
let fsUtils = cachedFsUtilsMap . get ( config )
47
47
if ( ! fsUtils ) {
48
- if ( config . command !== 'serve' || ! config . server . fs . cachedChecks ) {
49
- // cached fsUtils is only used in the dev server for now, and only when the watcher isn't configured
50
- // we can support custom ignored patterns later
48
+ if (
49
+ config . command !== 'serve' ||
50
+ config . server . fs . cachedChecks === false ||
51
+ config . server . watch ?. ignored
52
+ ) {
53
+ // cached fsUtils is only used in the dev server for now
54
+ // it is enabled by default only when there aren't custom watcher ignored patterns configured
51
55
fsUtils = commonFsUtils
52
56
} else if (
53
57
! config . resolve . preserveSymlinks &&
Original file line number Diff line number Diff line change @@ -194,10 +194,10 @@ export interface FileSystemServeOptions {
194
194
deny ?: string [ ]
195
195
196
196
/**
197
- * Enable caching of fs calls.
197
+ * Enable caching of fs calls. It is enabled by default if no custom watch ignored patterns are provided.
198
198
*
199
199
* @experimental
200
- * @default true
200
+ * @default undefined
201
201
*/
202
202
cachedChecks ?: boolean
203
203
}
@@ -1002,7 +1002,7 @@ export function resolveServerOptions(
1002
1002
strict : server . fs ?. strict ?? true ,
1003
1003
allow : allowDirs ,
1004
1004
deny,
1005
- cachedChecks : server . fs ?. cachedChecks ?? true ,
1005
+ cachedChecks : server . fs ?. cachedChecks ,
1006
1006
}
1007
1007
1008
1008
if ( server . origin ?. endsWith ( '/' ) ) {
You can’t perform that action at this time.
0 commit comments