44 lines
1003 B
TypeScript
44 lines
1003 B
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 { TDesignResolver } from '@tdesign-vue-next/auto-import-resolver';
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
AutoImport({
|
|
resolvers: [TDesignResolver({
|
|
library: 'vue-next'
|
|
})],
|
|
}),
|
|
Components({
|
|
resolvers: [TDesignResolver({
|
|
library: 'vue-next'
|
|
})],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
cors: true,
|
|
open: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8080',
|
|
changeOrigin: true,
|
|
rewrite: (path: string) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
}
|
|
})
|