import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { fileURLToPath } from 'node:url' const root = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ base: './', plugins: [react()], resolve: { alias: { '@': root + 'src' } }, define: { 'process.env.NODE_ENV': JSON.stringify('production') }, build: { target: 'es2022', sourcemap: false, // Static Space index.html points at production JS. Always build from TSX, not that old bundle. lib: { entry: root + 'src/main.tsx', formats: ['es'], fileName: () => 'app.js' }, }, })