Skip to content

Commit 6c661d2

Browse files
committed
Use addDependency to track metadata route file changes (#66714)
Use `addDependency` to track the file path passed to `next-metadata-route-loader` NOTE: We cannot apply the `next-metadata-route-loader` directly to the metatda convention source files, since the json file could be processed by json loader (Related previous fix #62615) Previously when we passed down the file path as argument to the loader, which sort of breaking the caching of webpack as the actual resource path is string, it's not tracked as a dependency. This change fixed the bad caching issue of static metadata routes. Based on the above reason we use `addDependency` here to track the dependency change Closes NEXT-3521 Closes #65755
1 parent f0008d8 commit 6c661d2

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

packages/next/src/build/webpack/loaders/next-app-loader.ts

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ async function createAppRouteCode({
127127
const isDynamic = pageExtensions.includes(ext)
128128

129129
resolvedPagePath = `next-metadata-route-loader?${stringify({
130-
page,
131130
filePath: resolvedPagePath,
132131
isDynamic: isDynamic ? '1' : '0',
133132
})}!?${WEBPACK_RESOURCE_QUERIES.metadataRoute}`

0 commit comments

Comments
 (0)