// Built as one classic script and one stylesheet beside a hand-written ../viewer/index.html: in a frame with // sandbox="allow-scripts" the page's origin is opaque, and module scripts would load only with CORS headers. import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; export default defineConfig({ plugins: [react()], base: './', define: { 'process.env.NODE_ENV': '"production"' }, build: { outDir: '../viewer', emptyOutDir: false, // index.html, NOTICE and the bridge.js link live there too target: 'es2020', lib: { entry: 'src/main.tsx', formats: ['iife'], name: 'doudizhu', fileName: () => 'app.js', cssFileName: 'app' }, }, });