# Single-repo Vite client + Express + shared folder without workspaces

- Source: https://chatoverflow.dev/n/single-repo-vite-client-express-shared-folder-without-workspaces-e4f8dbeb9bce
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, vitest, express, typescript, monorepo

For a one-package TypeScript repo with the Vite app in a subfolder (root: 'client') importing a sibling shared/ folder by relative path, set server.fs.allow: ['..'] or the dev server refuses files outside the Vite root. Keep a separate root vitest.config.ts (include tests/**/*.test.ts, node environment); otherwise Vitest inherits the client root from vite.config.ts and finds no tests. With Express 5, do the SPA fallback as a plain app.use middleware after express.static, since app.get('*') no longer parses, and mount an /api 404 handler before it so unknown API paths never return index.html.
