frontend/vite.config.js

87 lines
2.1 KiB
JavaScript
Raw Normal View History

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import path from 'path'
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
2024-09-13 22:10:26 +08:00
import VueRouter from 'unplugin-vue-router/vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
2024-09-13 22:10:26 +08:00
VueRouter({
routesFolder: 'src/views'
}),
UnoCSS(),
Components({
resolvers: [
AntDesignVueResolver({
importStyle: false, // css in js
}),
],
}),
],
server:{
open: true,
proxy: {
'/api/v1': {
2024-05-14 22:38:10 +08:00
target: 'https://ht.timerzz.com:20443/',
// target: 'http://192.168.31.55:2280/',
changeOrigin: true,
secure: false,
ws: true,
},
2024-09-13 22:10:26 +08:00
'/api/v2/sellers': {
2024-11-30 20:26:38 +08:00
target: 'http://localhost:8081/',
// target: 'https://ht.timerzz.com:20443/',
2024-08-27 14:26:41 +08:00
changeOrigin: true,
secure: false,
ws: true,
2024-09-13 22:10:26 +08:00
},
'/api/v2/seller': {
2024-11-30 20:26:38 +08:00
target: 'http://localhost:8083/',
// target: 'https://ht.timerzz.com:20443/',
2024-09-13 22:10:26 +08:00
changeOrigin: true,
secure: false,
ws: true,
},
'/api/v2/providers': {
target: 'http://localhost:8080/',
2024-11-21 14:35:50 +08:00
// target: 'https://ht.timerzz.com:20443/',
2024-09-13 22:10:26 +08:00
changeOrigin: true,
secure: false,
ws: true,
},
'/api/v2/provider': {
target: 'http://172.21.195.130:8082/',
2024-11-21 14:35:50 +08:00
// target: 'https://ht.timerzz.com:20443/',
2024-09-13 22:10:26 +08:00
changeOrigin: true,
secure: false,
ws: true,
},
'/api/v2/articles': {
2024-11-21 14:35:50 +08:00
// target: 'https://ht.timerzz.com:20443/',
2024-09-13 22:10:26 +08:00
target: 'http://localhost:8085/',
changeOrigin: true,
secure: false,
ws: true,
2024-11-30 20:26:38 +08:00
},
'/api/v2/watchers': {
// target: 'https://ht.timerzz.com:20443/',
target: 'http://localhost:8087/',
changeOrigin: true,
secure: false,
ws: true,
2024-08-27 14:26:41 +08:00
}
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, "./src")
}
}
})