vite-plugin-generoutes 0.0.3 → 0.0.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.
package/dist/index.js CHANGED
@@ -78,13 +78,12 @@ function generateMenusAndRoutes() {
78
78
  const defineOptions = parseDefineOptions(filePath);
79
79
  defineOptionsCache.set(filePath, JSON.stringify(defineOptions));
80
80
  const meta = defineOptions?.meta || {};
81
- const pagePath = `/${filePath}`;
82
81
  const fileName = path.basename(filePath);
83
- const pageFolders = pagePath.replace("/src/pages/", "").replace(fileName, "").split("/").filter((item) => !!item && !/^\(.*\)$/.test(item));
82
+ const pageFolders = filePath.replace("src/pages/", "").replace(fileName, "").split("/").filter((item) => !!item && !/^\(.*\)$/.test(item));
84
83
  meta.id = pageFolders.join("_") || "Index";
85
84
  const name = defineOptions?.name || meta.id;
86
85
  meta.parentId = pageFolders.slice(0, -1).join("_") || null;
87
- const component = `##${pagePath}##`;
86
+ const component = `##${filePath}##`;
88
87
  const folderPath = `/${pageFolders.map((item) => item.replace(/\[(.*?)\]/g, (_, p1) => p1.split(",").map((i) => `:${i}`).join("/"))).join("/")}`;
89
88
  let routePath = folderPath;
90
89
  if (meta.isNotFound) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-generoutes",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.7",
5
5
  "packageManager": "pnpm@9.1.1",
6
6
  "description": "_description_",
7
7
  "author": "Ronnie Zhang <zclzone@outlook.com>",
package/dist/routes.d.ts DELETED
@@ -1,3 +0,0 @@
1
- const routes = [];
2
-
3
- export { routes };
package/dist/routes.js DELETED
@@ -1,5 +0,0 @@
1
- // src/routes.js
2
- var routes = [];
3
- export {
4
- routes
5
- };