|
|
@@ -2,6 +2,7 @@ import path from 'node:path'
|
|
|
import process from 'node:process'
|
|
|
import Uni from '@uni-helper/plugin-uni'
|
|
|
import Components from '@uni-helper/vite-plugin-uni-components'
|
|
|
+import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
|
|
|
// @see https://uni-helper.js.org/vite-plugin-uni-layouts
|
|
|
import UniLayouts from '@uni-helper/vite-plugin-uni-layouts'
|
|
|
// @see https://github.com/uni-helper/vite-plugin-uni-manifest
|
|
|
@@ -71,7 +72,12 @@ export default defineConfig(({ command, mode }) => {
|
|
|
exclude: ['**/components/**/**.*'],
|
|
|
// pages 目录为 src/pages,分包目录不能配置在pages目录下!!
|
|
|
// 是个数组,可以配置多个,但是不能为pages里面的目录!!
|
|
|
- subPackages: [],
|
|
|
+ subPackages: [
|
|
|
+ 'src/pages-fg', // 这个是相对必要的路由,尽量留着(登录页、注册页、404页等)
|
|
|
+ 'src/pages-system', // “系统管理”模块
|
|
|
+ 'src/pages-infra', // “基础设施”模块
|
|
|
+ 'src/pages-bpm', // “工作流程”模块
|
|
|
+ ],
|
|
|
dts: 'src/types/uni-pages.d.ts',
|
|
|
}),
|
|
|
// Optimization 插件需要 page.json 文件,故应在 UniPages 插件之后执行
|
|
|
@@ -146,6 +152,13 @@ export default defineConfig(({ command, mode }) => {
|
|
|
},
|
|
|
),
|
|
|
syncManifestPlugin(),
|
|
|
+ Components({
|
|
|
+ resolvers: [WotResolver()],
|
|
|
+ extensions: ['vue'],
|
|
|
+ deep: true, // 是否递归扫描子目录,
|
|
|
+ directoryAsNamespace: false, // 是否把目录名作为命名空间前缀,true 时组件名为 目录名+组件名,
|
|
|
+ dts: 'src/types/components.d.ts', // 自动生成的组件类型声明文件路径(用于 TypeScript 支持)
|
|
|
+ }),
|
|
|
// 自动打开开发者工具插件 (必须修改 .env 文件中的 VITE_WX_APPID)
|
|
|
openDevTools(),
|
|
|
],
|