Rocky_Mountain_Vending/.pnpm-store/v10/files/c3/ef1e5eb19f7f00af36d1711af52caaf1ac4ecb4852b112960918ac562631576661ca2a31856ea911afa55aebed764b6417fd8936cc98ff46190df5d68e48e7
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

33 lines
No EOL
1.4 KiB
Text

import path from '../../../shared/lib/isomorphic/path';
import { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path';
import { isDynamicRoute } from '../../../shared/lib/router/utils/is-dynamic';
import { getNamedRouteRegex } from '../../../shared/lib/router/utils/route-regex';
import { normalizeRouteRegex } from '../../../lib/load-custom-routes';
import { escapeStringRegexp } from '../../../shared/lib/escape-regexp';
export function buildDataRoute(page, buildId) {
const pagePath = normalizePagePath(page);
const dataRoute = path.posix.join('/_next/data', buildId, `${pagePath}.json`);
let dataRouteRegex;
let namedDataRouteRegex;
let routeKeys;
if (isDynamicRoute(page)) {
const routeRegex = getNamedRouteRegex(dataRoute, {
prefixRouteKeys: true,
includeSuffix: true,
excludeOptionalTrailingSlash: true
});
dataRouteRegex = normalizeRouteRegex(routeRegex.re.source);
namedDataRouteRegex = routeRegex.namedRegex;
routeKeys = routeRegex.routeKeys;
} else {
dataRouteRegex = normalizeRouteRegex(new RegExp(`^${path.posix.join('/_next/data', escapeStringRegexp(buildId), `${pagePath}\\.json`)}$`).source);
}
return {
page,
routeKeys,
dataRouteRegex,
namedDataRouteRegex
};
}
//# sourceMappingURL=build-data-route.js.map