vite-plugin-generoutes 0.0.15 → 0.0.16
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 +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function VitePluginGeneroutes(options = {}) {
|
|
|
20
20
|
const filePath = `${routesFolder}/index.js`;
|
|
21
21
|
fs.writeFileSync(filePath, routesStr);
|
|
22
22
|
try {
|
|
23
|
-
exec(`npx eslint --fix ${filePath}`);
|
|
23
|
+
exec(`npx eslint --fix ${filePath} --no-ignore`);
|
|
24
24
|
} catch (error) {
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -37,8 +37,7 @@ function VitePluginGeneroutes(options = {}) {
|
|
|
37
37
|
const name = defineOptions?.name || meta.id;
|
|
38
38
|
meta.parentId = pageFolders.slice(0, -1).join("_") || null;
|
|
39
39
|
const component = `##/${filePath}##`;
|
|
40
|
-
|
|
41
|
-
let routePath = folderPath;
|
|
40
|
+
let routePath = `/${pageFolders.map((item) => item.replace(/\[(.*?)\]/g, (_, p1) => p1.split(",").map((i) => `:${i}`).join("/"))).join("/")}`;
|
|
42
41
|
if (meta.isNotFound) {
|
|
43
42
|
routePath = "/:pathMatch(.*)*";
|
|
44
43
|
}
|