[全量] 初始化项目代码、配置、文档及Agent协同harness
This commit is contained in:
50
chat_web_front/vite.config.ts
Normal file
50
chat_web_front/vite.config.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig,loadEnv } from 'vite'
|
||||
import type { PluginOption } 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 { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||
|
||||
function setupPlugins(env: ImportMetaEnv): PluginOption[] {
|
||||
return [
|
||||
vue(),
|
||||
vueDevTools(),
|
||||
// topLevelAwait(),
|
||||
AutoImport({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
export default defineConfig((env) => {
|
||||
const viteEnv = loadEnv(env.mode, process.cwd()) as unknown as ImportMetaEnv
|
||||
return {
|
||||
base: viteEnv.VITE_GLOB_FRONT_CTX,
|
||||
plugins: setupPlugins(viteEnv),
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: viteEnv.VITE_GLOB_FRONT_PORT,
|
||||
open: false,
|
||||
proxy: {
|
||||
[viteEnv.VITE_GLOB_API_CTX]: {
|
||||
target: viteEnv.VITE_GLOB_API_DEV_IP,
|
||||
changeOrigin: true,
|
||||
}
|
||||
},
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user