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>
22 lines
No EOL
1.1 KiB
Text
22 lines
No EOL
1.1 KiB
Text
import { getLayoutOrPageModule } from '../lib/app-dir-module';
|
|
import { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree';
|
|
export async function anySegmentHasRuntimePrefetchEnabled(tree) {
|
|
const { mod: layoutOrPageMod } = await getLayoutOrPageModule(tree);
|
|
// TODO(restart-on-cache-miss): Does this work correctly for client page/layout modules?
|
|
const prefetchConfig = layoutOrPageMod ? layoutOrPageMod.unstable_prefetch : undefined;
|
|
/** Whether this segment should use a runtime prefetch instead of a static prefetch. */ const hasRuntimePrefetch = (prefetchConfig == null ? void 0 : prefetchConfig.mode) === 'runtime';
|
|
if (hasRuntimePrefetch) {
|
|
return true;
|
|
}
|
|
const { parallelRoutes } = parseLoaderTree(tree);
|
|
for(const parallelRouteKey in parallelRoutes){
|
|
const parallelRoute = parallelRoutes[parallelRouteKey];
|
|
const hasChildRuntimePrefetch = await anySegmentHasRuntimePrefetchEnabled(parallelRoute);
|
|
if (hasChildRuntimePrefetch) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//# sourceMappingURL=staged-validation.js.map |