- 新增 axios/utils/directives/api/assets 五大基础设施目录(与生产 vue 项目 1:1) - 重构 FilterBar / TableCard 支持 :table 对象与 default slot - 新增列表页/弹框/抽屉/详情页/Tabs 等代码规范文档 - arcEmployee 作为新规范标准列表页样板重构 - 清理 .claude/tmp 临时截图
60 lines
2.2 KiB
TypeScript
60 lines
2.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
import { AntDesignVueResolver, VantResolver } from 'unplugin-vue-components/resolvers'
|
||
import { fileURLToPath, URL } from 'node:url'
|
||
|
||
/**
|
||
* Vite 构建配置
|
||
* - 端口固定 5180,避开正式工程 7000-7009
|
||
* - 自动导入 Vue / Vue Router 核心 API
|
||
* - 自动注册 Ant Design Vue(Web 端)与 Vant(移动端)组件
|
||
*/
|
||
export default defineConfig({
|
||
server: {
|
||
port: 5180,
|
||
host: true,
|
||
open: false,
|
||
},
|
||
|
||
resolve: {
|
||
alias: {
|
||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||
'@meta': fileURLToPath(new URL('./src/meta', import.meta.url)),
|
||
'@layouts': fileURLToPath(new URL('./src/layouts', import.meta.url)),
|
||
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
|
||
'@composables': fileURLToPath(new URL('./src/composables', import.meta.url)),
|
||
'@pages': fileURLToPath(new URL('./src/pages', import.meta.url)),
|
||
'@router': fileURLToPath(new URL('./src/router', import.meta.url)),
|
||
// 与 vue 研发项目对齐:业务直接使用 @utils @axios @assets @directives @api
|
||
'@utils': fileURLToPath(new URL('./src/utils', import.meta.url)),
|
||
'@axios': fileURLToPath(new URL('./src/axios', import.meta.url)),
|
||
'@assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
|
||
'@directives': fileURLToPath(new URL('./src/directives', import.meta.url)),
|
||
'@api': fileURLToPath(new URL('./src/api', import.meta.url)),
|
||
},
|
||
},
|
||
|
||
plugins: [
|
||
vue(),
|
||
|
||
/** 自动导入 Vue/Vue Router API,无需手动 import */
|
||
AutoImport({
|
||
imports: ['vue', 'vue-router'],
|
||
dts: 'src/types/auto-imports.d.ts',
|
||
eslintrc: { enabled: false },
|
||
}),
|
||
|
||
/** 自动注册组件库 + 项目公共组件 */
|
||
Components({
|
||
dts: 'src/types/components.d.ts',
|
||
dirs: ['src/components', 'src/layouts/components'],
|
||
resolvers: [
|
||
AntDesignVueResolver({ importStyle: false }), // 样式由 reset.css 与组件运行时注入
|
||
VantResolver(),
|
||
],
|
||
}),
|
||
],
|
||
})
|