You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9 KiB
TypeScript

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
import AutoImport from 'unplugin-auto-import/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
// 将 micro-app 标签作为自定义元素处理
isCustomElement: tag => tag.startsWith('micro-app')
}
}
}),
AutoImport({
imports: [
'vue',
'vue-router',
'pinia',
],
dts: 'src/auto-imports.d.ts',
eslintrc: {
enabled: false,
},
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
build: {
outDir: 'dist',
assetsDir: 'assets',
// 生产环境移除 console
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
// flow-app 子应用代理
'/flowapp': {
target: 'http://localhost:9222',
changeOrigin: true,
},
// databuilder 数据工厂服务
'/api/databuilder': {
// target: 'http://192.168.8.131:29380',
target: 'https://aistudio.ngsk.tech:7001/',
changeOrigin: true,
},
// 数据工厂专用鉴权接口
'/api/databuilder/v1/': {
// target: 'http://192.168.8.131:8084',
target: 'https://aistudio.ngsk.tech:7001/',
changeOrigin: true,
},
},
},
})