zephyr-frontend/vite.config.ts
Dustella 0909d5a32c
Some checks are pending
Test / build (lts/*, ubuntu-latest) (push) Waiting to run
Test / build (lts/*, windows-latest) (push) Waiting to run
fix some range
2025-03-20 12:48:39 +08:00

76 lines
1.6 KiB
TypeScript

/// <reference types="vitest" />
import path from 'node:path'
import Vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import VueRouter from 'unplugin-vue-router/vite'
import { defineConfig } from 'vite'
import vueDevTools from 'vite-plugin-vue-devtools'
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:58620',
},
'/api/ping': {
target: 'ws://localhost:58620',
ws: true,
rewriteWsOrigin: false,
},
},
},
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
},
},
plugins: [
Vue({
script: {
propsDestructure: true,
defineModel: true,
},
}),
// https://github.com/posva/unplugin-vue-router
VueRouter(),
vueDevTools(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
'vue',
'@vueuse/core',
VueRouterAutoImports,
{
// add any other imports you were relying on
'vue-router/auto': ['useLink'],
},
],
dts: true,
dirs: [
'./src/composables',
],
vueTemplate: true,
}),
// https://github.com/antfu/vite-plugin-components
Components({
dts: true,
}),
// https://github.com/antfu/unocss
// see uno.config.ts for config
UnoCSS(),
],
// https://github.com/vitest-dev/vitest
test: {
environment: 'jsdom',
},
})