Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ const nextConfig = {
permanent: false
}
];
},
// Vercel's skew protection appends `?dpl=<deployment id>` to asset URLs.
// `next/font` bakes that query into the CSS `url()`s at build time, but
// Next's webpack cache key ignores the deployment id, so a restored
// `.next/cache` re-emits CSS with the previous deployment's id and every
// font downloads twice (once per id). Fold the id into the cache key.
webpack(config) {
const deploymentId = process.env.NEXT_DEPLOYMENT_ID;
if (deploymentId && config.cache) {
config.cache.version = `${config.cache.version}|${deploymentId}`;
}
return config;
}
};

Expand Down
Loading