@dongmingzhixiu/vuexir 0.5.6 → 0.5.7

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.
@@ -27,10 +27,13 @@ export function generateAndroid(opts = {}) {
27
27
  if (/\.(ts|js|mts)$/.test(input) && existsSync(input)) {
28
28
  return runTabs(dirname(input), { routerFile: input, outDirRoot: opts.outDirRoot, projectName: opts.projectName, bundleId: opts.bundleId, renderGradle: (p, b) => buildGradle(b), templateVersion: TEMPLATE_VERSION });
29
29
  }
30
- if (!existsSync(join(input, 'router.ts'))) {
31
- throw new Error(`[vrn] ${input} 缺少 router.ts(多页模式需要 router.ts;单页请用 gen-ios 路径或补 router.ts)`);
30
+ // 目录入口:兼容 router.ts / index.ts(Vue 工程标准 src/router/index.ts)
31
+ const routerFile = ['router.ts', 'router.js', 'index.ts', 'index.js'].find((f) => existsSync(join(input, f)));
32
+ if (!routerFile) {
33
+ throw new Error(`[vrn] ${input} 缺少 router.ts/index.ts(多页模式需要路由文件;单页请用 gen-ios 路径或补 router.ts)`);
32
34
  }
33
35
  return runTabs(input, {
36
+ routerFile: join(input, routerFile),
34
37
  outDirRoot: opts.outDirRoot,
35
38
  projectName: opts.projectName,
36
39
  bundleId: opts.bundleId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongmingzhixiu/vuexir",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "vrn 命令行:build ios|android、preview、doctor",
5
5
  "type": "module",
6
6
  "license": "MIT",