mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 02:09:20 +08:00
74 lines
2.0 KiB
JavaScript
74 lines
2.0 KiB
JavaScript
import { fileURLToPath, URL } from 'node:url';
|
|
|
|
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
// import vueDevTools from 'vite-plugin-vue-devtools';
|
|
|
|
import Icons from 'unplugin-icons/vite';
|
|
import IconsResolver from 'unplugin-icons/resolver';
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
// vueDevTools(),
|
|
AutoImport({
|
|
resolvers: [
|
|
ElementPlusResolver(), // Auto import icon components
|
|
// 自动导入图标组件
|
|
IconsResolver({
|
|
prefix: 'Icon'
|
|
})
|
|
],
|
|
imports: ['vue', 'vue-router', '@vueuse/core'],
|
|
dirs: ['src/apis/**/*', 'src/hooks/*'],
|
|
vueTemplate: true,
|
|
eslintrc: {
|
|
enabled: true
|
|
}
|
|
}),
|
|
Components({
|
|
resolvers: [
|
|
ElementPlusResolver(), // 自动注册图标组件
|
|
IconsResolver({
|
|
enabledCollections: ['ep']
|
|
})
|
|
],
|
|
dirs: ['src/components']
|
|
}),
|
|
Icons({
|
|
autoInstall: true
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
additionalData: `@import 'src/styles/element/index.less';`
|
|
}
|
|
}
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 8088,
|
|
proxy: {
|
|
'/api/v1': {
|
|
target: 'http://127.0.0.1:32550',
|
|
ws: true,
|
|
changeOrigin: true
|
|
},
|
|
'/ws': {
|
|
target: 'http://127.0.0.1:32550',
|
|
ws: true,
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
}
|
|
});
|