Files
AlgerMusicPlayer/vite.config.ts

40 lines
958 B
TypeScript
Raw Normal View History

2023-12-18 19:39:36 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import VueDevTools from 'vite-plugin-vue-devtools'
2021-07-19 17:36:48 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2023-12-18 23:07:44 +08:00
plugins: [vue(), VueDevTools()],
base: './',
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://110.42.251.190:4100',
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
})