import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { realpathSync } from 'node:fs'; import { resolve } from 'node:path'; // The simulated instruments live in the sibling collection (the vault // layout): each repo carries an instrument/ module implementing the // track-render interface plus the MATLAB sources it globs at build time, // imported directly by src/instruments/sim.ts, so the dev server must be // allowed to read them from their real path. const simulated = realpathSync(resolve(import.meta.dirname, '../../simulated_instruments')); export default defineConfig({ base: './', plugins: [react()], server: { fs: { allow: [import.meta.dirname, simulated] } }, build: { target: 'es2022' }, });