@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.
15 lines (11 loc) • 353 B
text/typescript
import path from "node:path";
import { getPageName } from "../utils/getPageName.js";
export function removeSsgUrl(url: string): string {
return getPageName(url.replace("/@ssg/", ""));
}
export function isSsgUrl(id: string) {
return id.startsWith("/@ssg/");
}
export function createSsgUrl(url: string) {
return path.posix.join("/@ssg/", url);
}