Files
AlgerMusicPlayer/vite.config.ts

39 lines
941 B
TypeScript
Raw Normal View History

2021-11-08 17:04:38 +08:00
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import path from "path"
2023-07-29 15:08:41 +08:00
import VueDevTools from "vite-plugin-vue-devtools"
2021-07-19 17:36:48 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2023-07-29 15:08:41 +08:00
plugins: [vue(), VueDevTools()],
2021-07-19 17:36:48 +08:00
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
2021-07-19 17:36:48 +08:00
},
},
2021-10-11 12:06:53 +08:00
server: {
host: '0.0.0.0', //允许本机
2023-12-18 16:41:56 +08:00
// 指定端口
port: 4678,
2021-10-11 12:06:53 +08:00
proxy: {
// string shorthand
'/mt': {
target: 'http://mt.myalger.top',
2021-10-11 12:06:53 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/mt/, ''),
2021-10-11 12:06:53 +08:00
},
// with options
'/api': {
target: 'http://110.42.251.190:9898',
2021-10-11 12:06:53 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
2021-10-11 12:06:53 +08:00
},
'/music': {
target: 'http://myalger.top:4000',
2021-11-08 17:04:38 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/music/, ''),
2021-11-08 17:04:38 +08:00
},
2021-10-11 12:06:53 +08:00
},
},
2021-11-08 17:04:38 +08:00
})