55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
base: '/my-v0/',
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
AutoImport({
|
|
imports: ['vue', 'vue-router', 'pinia'],
|
|
resolvers: [ElementPlusResolver()],
|
|
}),
|
|
Components({
|
|
resolvers: [ElementPlusResolver()],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
rolldownOptions: {
|
|
output: {
|
|
codeSplitting: {
|
|
groups: [
|
|
{ name: 'vue', test: /node_modules\/(vue|pinia|vue-router)\// },
|
|
{ name: 'element-plus', test: /node_modules\/element-plus\// },
|
|
{
|
|
name: 'canvas',
|
|
test: /node_modules\/(vue3-moveable|vue3-selecto|vue3-sketch-ruler)\//,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
allowedHosts: ['www.qflink.xyz'],
|
|
proxy: {
|
|
'/agent': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|