34 lines
577 B
TypeScript
34 lines
577 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react()
|
|
],
|
|
base: '/',
|
|
server: {
|
|
port: 3000,
|
|
open: true,
|
|
host: true,
|
|
// 代理配置解决跨域问题
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8082',
|
|
changeOrigin: true,
|
|
secure: false
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
target: 'esnext',
|
|
minify: 'esbuild',
|
|
outDir: 'dist'
|
|
}
|
|
})
|