36 lines
835 B
TypeScript
36 lines
835 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
allowedHosts: ["duooomi.com"],
|
|
proxy: {
|
|
// Avoid browser CORS by tunneling requests to the upstream API.
|
|
// `src/lib/auth-client.ts` uses baseURL `/duooomi` in dev.
|
|
"/duooomi": {
|
|
target: "https://api.duooomi.com",
|
|
changeOrigin: true,
|
|
secure: true,
|
|
rewrite: (path) => path.replace(/^\/duooomi/, ""),
|
|
},
|
|
},
|
|
},
|
|
preview: {
|
|
allowedHosts: ["duooomi.com"]
|
|
},
|
|
plugins: [
|
|
react({
|
|
babel: {
|
|
plugins: [['babel-plugin-react-compiler']],
|
|
},
|
|
}),
|
|
],
|
|
})
|