Overview of gen-route-next-page plugin
The
gen-route-next-page plugin is designed for the Next.js Pages Router. It scans the pages directory and generates a TypeScript object where keys represent route names and values represent the actual URL paths. This prevents hard-coding strings throughout the application and provides a centralized, stable way to manage routes.// Generated output example
export const ROUTES = {
AUTH_MAIN: "/auth",
MAIN: "/",
LOGIN_MAIN: "/login",
SOCIAL_CALLBACK: "/social/callback",
};