@ray-js/build-plugin-router 0.5.2 → 0.5.3

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.
Files changed (2) hide show
  1. package/lib/index.js +14 -3
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -71,7 +71,7 @@ function PluginRouter(api) {
71
71
  * @param appConfig - 已存在的应用配置
72
72
  */
73
73
  getWechatAppConfigData(routesConfig, globalConfig) {
74
- const { routes, tabBar } = routesConfig;
74
+ const { routes, tabBar, subpackages = [] } = routesConfig;
75
75
  const pages = routes.map((r) => r.path.replace(/^\//, ''));
76
76
  const tabBarConfig = {};
77
77
  if (tabBar === null || tabBar === void 0 ? void 0 : tabBar.textColor) {
@@ -97,7 +97,15 @@ function PluginRouter(api) {
97
97
  };
98
98
  });
99
99
  }
100
- const config = Object.assign({}, globalConfig, { pages, tabBar: tabBarConfig });
100
+ const subpackagesConfig = subpackages.map((subpackage) => {
101
+ var _a;
102
+ return Object.assign(Object.assign({}, subpackage), { pages: (_a = subpackage.pages) === null || _a === void 0 ? void 0 : _a.map((r) => r.path.replace(/^\//, '')) });
103
+ });
104
+ const config = Object.assign({}, globalConfig, {
105
+ pages,
106
+ tabBar: tabBarConfig,
107
+ subpackages: subpackagesConfig,
108
+ });
101
109
  return config;
102
110
  },
103
111
  getTuyaAppConfigData(routesConfig, globalConfig) {
@@ -127,7 +135,10 @@ function PluginRouter(api) {
127
135
  };
128
136
  });
129
137
  }
130
- const config = Object.assign({}, globalConfig, { pages, tabBar: tabBarConfig });
138
+ const config = Object.assign({}, globalConfig, {
139
+ pages,
140
+ tabBar: tabBarConfig,
141
+ });
131
142
  return config;
132
143
  },
133
144
  generateAppConfig(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/build-plugin-router",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Ray build plugin for router",
5
5
  "keywords": [
6
6
  "ray"
@@ -21,13 +21,13 @@
21
21
  "watch": "tsc -p ./tsconfig.build.json --watch"
22
22
  },
23
23
  "dependencies": {
24
- "@ray-js/plugin-utils": "^0.5.2",
25
- "@ray-js/shared": "^0.5.2",
24
+ "@ray-js/plugin-utils": "^0.5.3",
25
+ "@ray-js/shared": "^0.5.3",
26
26
  "chokidar": "^3.5.2",
27
27
  "colors": "1.4.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@ray-js/types": "^0.5.2"
30
+ "@ray-js/types": "^0.5.3"
31
31
  },
32
32
  "maintainers": [
33
33
  {
@@ -35,6 +35,6 @@
35
35
  "email": "tuyafe@tuya.com"
36
36
  }
37
37
  ],
38
- "gitHead": "c9712e73da0123a95226174f9630e803a35f6a47",
38
+ "gitHead": "91c1640716664ef0123b9998c6668c4496293595",
39
39
  "repository": {}
40
40
  }