@wroud/vite-plugin-ssg
Version:
A Vite plugin for static site generation (SSG) with React. Renders React applications to static HTML for faster load times and improved SEO.
18 lines • 525 B
JavaScript
export function* getPathsToLookup(path) {
const parts = path.split("/");
for (let i = parts.length; i >= 0; i--) {
let pathPart = parts.slice(0, i).join("/");
if (pathPart.endsWith("/")) {
pathPart = pathPart.slice(0, -1);
}
if (pathPart && pathPart !== ".") {
yield pathPart;
yield pathPart + "/index";
}
else {
yield pathPart + "/index";
break;
}
}
}
//# sourceMappingURL=getPathsToLookup.js.map