new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vite · Config reference · all subjects

server options: file system

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

server.fs.allow basic example

Example of server.fs.allow: export default defineConfig({ server: { fs: { allow: ['..'] } } }) allows serving files from one level up to the project root

server.fs.allow with searchForWorkspaceRoot example

Example using searchForWorkspaceRoot utility: import { defineConfig, searchForWorkspaceRoot } from 'vite'; export default defineConfig({ server: { fs: { allow: [ searchForWorkspaceRoot(process.cwd()), '/path/to/custom/allow_directory', '/path/to/custom/allow_file.demo' ] } } })

server.watch type

The server.watch option is of type 'object | null'. It provides file system watcher options to pass to chokidar. The Vite server watcher watches the root and skips .git/, node_modules/, test-results/, and Vite's cacheDir and build.outDir directories by default. If set to null, no files will be watched.

server.fs.strict type and default

The server.fs.strict option is of type 'boolean' with a default value of true (enabled by default since Vite 2.7). It restricts serving files outside of workspace root.

server.fs.allow type and behavior

The server.fs.allow option is of type 'string[]'. It restricts files that could be served via /@fs/. When server.fs.strict is set to true, accessing files outside this directory list that aren't imported from an allowed file will result in a 403. Both directories and files can be provided.

server.fs.deny type and default

The server.fs.deny option is of type 'string[]' with a default value of ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**/.git/**']. It is a blocklist for sensitive files being restricted to be served by Vite dev server, with higher priority than server.fs.allow. It supports picomatch patterns.

Give your agent this brain