Files
AlgerMusicPlayer/vite.config.ts
T

73 lines
1.6 KiB
TypeScript
Raw Permalink 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'
2023-12-27 14:40:22 +08:00
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
2021-07-19 17:36:48 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2023-12-27 14:40:22 +08:00
plugins: [
vue(),
VueDevTools(),
AutoImport({
imports: [
'vue',
{
'naive-ui': [
'useDialog',
'useMessage',
'useNotification',
'useLoadingBar',
],
},
],
}),
Components({
resolvers: [NaiveUiResolver()],
}),
],
2023-12-18 23:07:44 +08:00
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
},
},
2023-12-27 14:40:22 +08:00
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['vue', 'axios'],
naiveui: ['naive-ui'],
lodash: ['lodash'],
},
},
},
},
2021-11-08 17:04:38 +08:00
})