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>
1 line
No EOL
3.7 KiB
Text
1 line
No EOL
3.7 KiB
Text
{"version":3,"sources":["../../../../src/shared/lib/lazy-dynamic/preload-chunks.tsx"],"sourcesContent":["'use client'\n\nimport { preload } from 'react-dom'\n\nimport { workAsyncStorage } from '../../../server/app-render/work-async-storage.external'\nimport { encodeURIPath } from '../encode-uri-path'\n\nexport function PreloadChunks({\n moduleIds,\n}: {\n moduleIds: string[] | undefined\n}) {\n // Early return in client compilation and only load requestStore on server side\n if (typeof window !== 'undefined') {\n return null\n }\n\n const workStore = workAsyncStorage.getStore()\n if (workStore === undefined) {\n return null\n }\n\n const allFiles = []\n\n // Search the current dynamic call unique key id in react loadable manifest,\n // and find the corresponding CSS files to preload\n if (workStore.reactLoadableManifest && moduleIds) {\n const manifest = workStore.reactLoadableManifest\n for (const key of moduleIds) {\n if (!manifest[key]) continue\n const chunks = manifest[key].files\n allFiles.push(...chunks)\n }\n }\n\n if (allFiles.length === 0) {\n return null\n }\n\n const dplId = process.env.NEXT_DEPLOYMENT_ID\n ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n\n return (\n <>\n {allFiles.map((chunk) => {\n const href = `${workStore.assetPrefix}/_next/${encodeURIPath(chunk)}${dplId}`\n const isCss = chunk.endsWith('.css')\n // If it's stylesheet we use `precedence` o help hoist with React Float.\n // 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.\n // The `preload` for stylesheet is not optional.\n if (isCss) {\n return (\n <link\n key={chunk}\n // @ts-ignore\n precedence=\"dynamic\"\n href={href}\n rel=\"stylesheet\"\n as=\"style\"\n nonce={workStore.nonce}\n />\n )\n } else {\n // If it's script we use ReactDOM.preload to preload the resources\n preload(href, {\n as: 'script',\n fetchPriority: 'low',\n nonce: workStore.nonce,\n })\n return null\n }\n })}\n </>\n )\n}\n"],"names":["PreloadChunks","moduleIds","window","workStore","workAsyncStorage","getStore","undefined","allFiles","reactLoadableManifest","manifest","key","chunks","files","push","length","dplId","process","env","NEXT_DEPLOYMENT_ID","map","chunk","href","assetPrefix","encodeURIPath","isCss","endsWith","link","precedence","rel","as","nonce","preload","fetchPriority"],"mappings":"AAAA;;;;;+BAOgBA;;;eAAAA;;;;0BALQ;0CAES;+BACH;AAEvB,SAASA,cAAc,EAC5BC,SAAS,EAGV;IACC,+EAA+E;IAC/E,IAAI,OAAOC,WAAW,aAAa;QACjC,OAAO;IACT;IAEA,MAAMC,YAAYC,0CAAgB,CAACC,QAAQ;IAC3C,IAAIF,cAAcG,WAAW;QAC3B,OAAO;IACT;IAEA,MAAMC,WAAW,EAAE;IAEnB,4EAA4E;IAC5E,kDAAkD;IAClD,IAAIJ,UAAUK,qBAAqB,IAAIP,WAAW;QAChD,MAAMQ,WAAWN,UAAUK,qBAAqB;QAChD,KAAK,MAAME,OAAOT,UAAW;YAC3B,IAAI,CAACQ,QAAQ,CAACC,IAAI,EAAE;YACpB,MAAMC,SAASF,QAAQ,CAACC,IAAI,CAACE,KAAK;YAClCL,SAASM,IAAI,IAAIF;QACnB;IACF;IAEA,IAAIJ,SAASO,MAAM,KAAK,GAAG;QACzB,OAAO;IACT;IAEA,MAAMC,QAAQC,QAAQC,GAAG,CAACC,kBAAkB,GACxC,CAAC,KAAK,EAAEF,QAAQC,GAAG,CAACC,kBAAkB,EAAE,GACxC;IAEJ,qBACE;kBACGX,SAASY,GAAG,CAAC,CAACC;YACb,MAAMC,OAAO,GAAGlB,UAAUmB,WAAW,CAAC,OAAO,EAAEC,IAAAA,4BAAa,EAACH,SAASL,OAAO;YAC7E,MAAMS,QAAQJ,MAAMK,QAAQ,CAAC;YAC7B,wEAAwE;YACxE,0IAA0I;YAC1I,gDAAgD;YAChD,IAAID,OAAO;gBACT,qBACE,qBAACE;oBAEC,aAAa;oBACbC,YAAW;oBACXN,MAAMA;oBACNO,KAAI;oBACJC,IAAG;oBACHC,OAAO3B,UAAU2B,KAAK;mBANjBV;YASX,OAAO;gBACL,kEAAkE;gBAClEW,IAAAA,iBAAO,EAACV,MAAM;oBACZQ,IAAI;oBACJG,eAAe;oBACfF,OAAO3B,UAAU2B,KAAK;gBACxB;gBACA,OAAO;YACT;QACF;;AAGN","ignoreList":[0]} |