import { defineConfig } from 'vite'; import { viteSingleFile } from 'vite-plugin-singlefile'; // Normal build: dist/ with hashed assets, relative base so it works under any subfolder. // Single-file build (SINGLE=1): one self-contained index.html for previews. export default defineConfig(({ mode }) => ({ base: './', build: { target: 'es2020', outDir: mode === 'single' ? 'dist-single' : 'dist', chunkSizeWarningLimit: 1200 }, plugins: mode === 'single' ? [viteSingleFile()] : [], }));