befly-vite 1.7.17 → 1.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/index.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,6 +150,7 @@ export default createBeflyViteConfig({
|
|
|
150
150
|
|
|
151
151
|
1. TDesign Vue Next resolver
|
|
152
152
|
2. TDesign 图标 resolver
|
|
153
|
+
3. `src/**/*.vue`、`node_modules/befly-admin-ui/**/*.vue`、`packages/adminUI/**/*.vue`(monorepo 本地源码)都会进入组件自动注册范围
|
|
153
154
|
|
|
154
155
|
如果项目还想增加额外 resolver,可以通过 `resolvers` 追加。它会同时追加到:
|
|
155
156
|
|
package/index.js
CHANGED
|
@@ -65,6 +65,10 @@ function resolveTDesignIcon(componentName) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
function createComponentsInclude() {
|
|
69
|
+
return [/[\\/]src[\\/].*\.vue$/, /[\\/]node_modules[\\/]befly-admin-ui[\\/].*\.vue$/, /[\\/]packages[\\/]adminUI[\\/].*\.vue$/];
|
|
70
|
+
}
|
|
71
|
+
|
|
68
72
|
/**
|
|
69
73
|
* 创建组件自动注册插件配置
|
|
70
74
|
*/
|
|
@@ -72,8 +76,8 @@ function createComponentsPlugin(options = {}) {
|
|
|
72
76
|
const { resolvers } = options;
|
|
73
77
|
|
|
74
78
|
return Components({
|
|
75
|
-
// 给 admin
|
|
76
|
-
include:
|
|
79
|
+
// 给 admin 自身源码、node_modules 中的 befly-admin-ui,以及 monorepo 源码 packages/adminUI 做组件自动注册
|
|
80
|
+
include: createComponentsInclude(),
|
|
77
81
|
resolvers: [createTDesignResolver(), resolveTDesignIcon, ...normalizeResolvers(resolvers)],
|
|
78
82
|
dirs: ["src/components"],
|
|
79
83
|
deep: true,
|