You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding project-specific patterns to server.fs.deny currently requires copying Vite's default list. Setting this option replaces that list entirely, as documented.
For example, our application also denies **/.local/** and **/.env.*/**. To retain Vite's defaults, we duplicate all six default patterns in our configuration and check the copy against Vite during upgrades. The configuration can otherwise miss defaults added by a later release.
Please expose the default patterns through the public Node API so applications can extend the list without maintaining a copy. This request preserves the existing replacement behavior of server.fs.deny.
I have a local implementation with tests and documentation and can submit it as a PR if this API is useful.
Suggested solution
Export a frozen readonly string[], for example defaultServerFsDeny, from vite:
Use the same constant for Vite's internal defaults, with a separate mutable array for each resolved configuration. Keep custom-only arrays and deny: [] working as they do today.
Alternative
Copying the patterns from the documentation works, but requires tracking changes to that list. Changing deny to append automatically would alter its existing replacement semantics; a public constant would allow explicit composition without a new configuration option.
Additional context
Verified with Vite 8.3.6. The public API already exposes other defaults such as defaultAllowedOrigins and defaultServerConditions.
Activity