tz / vite.config.ts
Surf
质检:387张真人IP封面、浏览器下载回归与可复现构建(推送 #23)
4f7ed0a
Raw History Blame Contribute Delete
600 Bytes
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' },
},
})