Skip to content

Commit

Permalink
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/config/server-options.md
Original file line number Diff line number Diff line change
@@ -328,6 +328,14 @@ export default defineConfig({

Blocklist for sensitive files being restricted to be served by Vite dev server. This will have higher priority than [`server.fs.allow`](#server-fs-allow). [picomatch patterns](https://github.com/micromatch/picomatch#globbing-features) are supported.

## server.fs.cachedChecks

- **Type:** `boolean`
- **Default:** `false`
- **Experimental**

Caches filenames of accessed directories to avoid repeated filesystem operations. Particularly in Windows, this could result in a performance boost. It is disabled by default due to edge cases when writing a file in a cached folder and immediately importing it.

## server.origin

- **Type:** `string`
6 changes: 4 additions & 2 deletions packages/vite/src/node/fsUtils.ts
Original file line number Diff line number Diff line change
@@ -46,12 +46,14 @@ export function getFsUtils(config: ResolvedConfig): FsUtils {
if (!fsUtils) {
if (
config.command !== 'serve' ||
config.server.fs.cachedChecks === false ||
config.server.fs.cachedChecks !== true ||
config.server.watch?.ignored ||
process.versions.pnp
) {
// cached fsUtils is only used in the dev server for now
// it is enabled by default only when there aren't custom watcher ignored patterns configured
// it is disabled by default due to potential edge cases when writing a file
// and reading it immediately
// It is also disabled when there aren't custom watcher ignored patterns configured
// and if yarn pnp isn't used
fsUtils = commonFsUtils
} else if (

0 comments on commit 4de659c

Please sign in to comment.