mirror of
https://github.com/Teamlinker/Teamlinker.git
synced 2025-06-03 03:00:17 +00:00
33 lines
965 B
TypeScript
33 lines
965 B
TypeScript
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
// typescript({
|
|
// // @ts-ignore
|
|
// typescript:ttypescript
|
|
// })
|
|
],
|
|
server:{
|
|
port: 3000,
|
|
hmr:true,
|
|
open: false, //自动打开
|
|
base: "./ ", //生产环境路径
|
|
proxy: { // 本地开发环境通过代理实现跨域,生产环境使用 nginx 转发
|
|
// 正则表达式写法
|
|
'^/api': {
|
|
target: 'http://localhost:14000/api', // 后端服务实际地址
|
|
changeOrigin: true, //开启代理
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
},
|
|
'^/file': {
|
|
target: 'http://localhost:14000/file', // 后端服务实际地址
|
|
changeOrigin: true, //开启代理
|
|
rewrite: (path) => path.replace(/^\/file/, '')
|
|
}
|
|
}
|
|
},
|
|
})
|