Rocky_Mountain_Vending/.pnpm-store/v10/files/41/6701a838c2616f74d19a1cc96d3c7278bd4bb092799c7fa810ed4d5b5c6f9df08c87af993f9b8fe42bca756032d52166a1aaae8abbb94fe7f7c4420f20063c
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

59 lines
No EOL
2.4 KiB
Text

'use client';
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { preload } from 'react-dom';
import { workAsyncStorage } from '../../../server/app-render/work-async-storage.external';
import { encodeURIPath } from '../encode-uri-path';
export function PreloadChunks({ moduleIds }) {
// Early return in client compilation and only load requestStore on server side
if (typeof window !== 'undefined') {
return null;
}
const workStore = workAsyncStorage.getStore();
if (workStore === undefined) {
return null;
}
const allFiles = [];
// Search the current dynamic call unique key id in react loadable manifest,
// and find the corresponding CSS files to preload
if (workStore.reactLoadableManifest && moduleIds) {
const manifest = workStore.reactLoadableManifest;
for (const key of moduleIds){
if (!manifest[key]) continue;
const chunks = manifest[key].files;
allFiles.push(...chunks);
}
}
if (allFiles.length === 0) {
return null;
}
const dplId = process.env.NEXT_DEPLOYMENT_ID ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}` : '';
return /*#__PURE__*/ _jsx(_Fragment, {
children: allFiles.map((chunk)=>{
const href = `${workStore.assetPrefix}/_next/${encodeURIPath(chunk)}${dplId}`;
const isCss = chunk.endsWith('.css');
// If it's stylesheet we use `precedence` o help hoist with React Float.
// For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree.
// The `preload` for stylesheet is not optional.
if (isCss) {
return /*#__PURE__*/ _jsx("link", {
// @ts-ignore
precedence: "dynamic",
href: href,
rel: "stylesheet",
as: "style",
nonce: workStore.nonce
}, chunk);
} else {
// If it's script we use ReactDOM.preload to preload the resources
preload(href, {
as: 'script',
fetchPriority: 'low',
nonce: workStore.nonce
});
return null;
}
})
});
}
//# sourceMappingURL=preload-chunks.js.map