You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
526 B

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
babel: {
plugins: [['babel-plugin-react-compiler']],
},
}),
],
server: {
host: '0.0.0.0', // 允许公网访问
port: 5173, // 默认端口
},
build: {
// 打包输出到项目根目录的 static 文件夹
outDir: path.resolve(__dirname, '../../static'),
emptyOutDir: true,
},
})