Skip to content

Commit 8151cb6

Browse files
ijjkhuozhi
authored andcommitted
Ensure deploymentId is used for CSS preloads (#77210)
This just ensures we use the deployment ID if configured for preload CSS links. x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1742146672858189)
1 parent 52a078d commit 8151cb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/next/src/shared/lib/lazy-dynamic/preload-chunks.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ export function PreloadChunks({
3737
return null
3838
}
3939

40+
const dplId = process.env.NEXT_DEPLOYMENT_ID
41+
? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`
42+
: ''
43+
4044
return (
4145
<>
4246
{allFiles.map((chunk) => {
43-
const href = `${workStore.assetPrefix}/_next/${encodeURIPath(chunk)}`
47+
const href = `${workStore.assetPrefix}/_next/${encodeURIPath(chunk)}${dplId}`
4448
const isCss = chunk.endsWith('.css')
4549
// If it's stylesheet we use `precedence` o help hoist with React Float.
4650
// 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.

0 commit comments

Comments
 (0)