40 lines
978 B
TypeScript
40 lines
978 B
TypeScript
import { defineConfig } from 'vite';
|
|||
|
|
import vue from '@vitejs/plugin-vue';
|
||
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
||
|
|
import Components from 'unplugin-vue-components/vite';
|
||
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||
|
|
import { fileURLToPath, URL } from 'node:url';
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [
|
||
|
|
vue(),
|
||
|
|
AutoImport({
|
||
|
|
resolvers: [ElementPlusResolver()],
|
||
|
|
imports: ['vue', 'vue-router', 'pinia'],
|
||
|
|
dts: 'src/auto-imports.d.ts',
|
||
|
|
}),
|
||
|
|
Components({
|
||
|
|
resolvers: [ElementPlusResolver()],
|
||
|
|
dts: 'src/components.d.ts',
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
server: {
|
||
|
|
port: 5173,
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: 'http://localhost:3000',
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'/socket': {
|
||
|
|
target: 'http://localhost:3000',
|
||
|
|
changeOrigin: true,
|
||
|
|
ws: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
});
|