init: 智养餐饮平台 V3 原型工程初始化
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
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)),
|
||||
},
|
||||
},
|
||||
|
||||
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(),
|
||||
],
|
||||
}),
|
||||
],
|
||||
})
|
||||
Reference in New Issue
Block a user