68 lines
1.9 KiB
TypeScript
68 lines
1.9 KiB
TypeScript
import { defineConfig } from '@vben/vite-config';
|
|
|
|
import { fileURLToPath, URL } from 'node:url';
|
|
|
|
import ElementPlus from 'unplugin-element-plus/vite';
|
|
|
|
const resolveLocal = (path: string) =>
|
|
fileURLToPath(new URL(path, import.meta.url));
|
|
|
|
export default defineConfig(async () => {
|
|
return {
|
|
application: {
|
|
injectMetadata: false,
|
|
license: false,
|
|
},
|
|
vite: {
|
|
resolve: {
|
|
alias: {
|
|
'#/components/form-editor': resolveLocal(
|
|
'./src/components/ai-chat-panel/form-editor-lite.ts',
|
|
),
|
|
'@vben-core/shared/cache': resolveLocal(
|
|
'../../packages/@core/base/shared/src/cache/index.ts',
|
|
),
|
|
'@vben-core/shared/color': resolveLocal(
|
|
'../../packages/@core/base/shared/src/color/index.ts',
|
|
),
|
|
'@vben-core/shared/constants': resolveLocal(
|
|
'../../packages/@core/base/shared/src/constants/index.ts',
|
|
),
|
|
'@vben-core/shared/global-state': resolveLocal(
|
|
'../../packages/@core/base/shared/src/global-state.ts',
|
|
),
|
|
'@vben-core/shared/store': resolveLocal(
|
|
'../../packages/@core/base/shared/src/store.ts',
|
|
),
|
|
'@vben-core/shared/utils': resolveLocal(
|
|
'../../packages/@core/base/shared/src/utils/index.ts',
|
|
),
|
|
'pinia-plugin-persistedstate': resolveLocal(
|
|
'../../node_modules/pinia-plugin-persistedstate/dist/index.js',
|
|
),
|
|
},
|
|
},
|
|
plugins: [
|
|
ElementPlus({
|
|
format: 'esm',
|
|
}),
|
|
],
|
|
server: {
|
|
proxy: {
|
|
'/basic-api': {
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/basic-api/, ''),
|
|
target: 'http://localhost:8000',
|
|
ws: true,
|
|
},
|
|
'/ws': {
|
|
changeOrigin: true,
|
|
target: 'ws://localhost:8000',
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|