26 lines
547 B
TypeScript
26 lines
547 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { dirname, resolve } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
root: __dirname,
|
|
base: '/admin/',
|
|
resolve: {
|
|
dedupe: ['react', 'react-dom']
|
|
},
|
|
build: {
|
|
outDir: resolve(__dirname, '../public/admin'),
|
|
emptyOutDir: true
|
|
},
|
|
server: {
|
|
port: 5174,
|
|
proxy: {
|
|
'/api': 'http://localhost:3100'
|
|
}
|
|
}
|
|
})
|