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.
 
 
 
myAmis/vite.config.js

43 lines
1.2 KiB

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {
fileURLToPath,
URL
} from 'node:url'
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
output: {
// 在这里修改静态资源路径
chunkFileNames: 'amisStatic/assets/js/[name]-[hash].js',
entryFileNames: 'amisStatic/assets/js/[name]-[hash].js',
assetFileNames: 'amisStatic/assets/[ext]/[name]-[hash].[ext]',
}
}
},
minify: true,
plugins: [react()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src',
import.meta.url))
}
},
server: {
host: "0.0.0.0",
proxy: {
'/api': {
// target: "http://10.10.10.107:9208",// 目标地址
target: `http://10.10.10.168:8080`,// sar目标地址
// target: `http://10.10.10.200/api/`,// 测试服务器址
// target: "http://10.10.10.146:9309",// Rock目标地址
// target: `http://togy.top:18080/api/`,// sar目标地址
ws: true,// 开始ws代理
changeOrigin: true, // 开发模式
rewrite: (path) => path.replace(/^\/api/, "")
},
}
},
})