| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import { resolve } from 'path'
- export default defineConfig(({ mode }) => ({
- base: '/',
- plugins: [vue()],
- resolve: {
- alias: [
- { find: '@', replacement: resolve(__dirname, 'src') },
- // logicflow module 字段指向 UMD bundle,Rollup 当 ESM 处理会 TDZ,精确匹配强制走 CJS
- { find: /^@logicflow\/core$/, replacement: '@logicflow/core/dist/entry.js' },
- { find: /^@logicflow\/extension$/, replacement: '@logicflow/extension/cjs/index.js' }
- ]
- },
- build: {
- sourcemap: mode !== 'production',
- chunkSizeWarningLimit: 1000,
- rollupOptions: {
- output: {
- manualChunks: {
- 'element-plus': ['element-plus'],
- 'vue-vendor': ['vue', 'vue-router', 'pinia']
- }
- }
- }
- },
- server: {
- port: 3000,
- proxy: {
- '/api': {
- target: 'http://localhost:8080',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, '')
- },
- '/uploads': {
- target: 'http://localhost:8080',
- changeOrigin: true
- },
- '/analysis': {
- target: 'http://localhost:8080',
- changeOrigin: true
- }
- }
- }
- }))
|