Unverified Commit ec438418 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Fix missing `devPageFiles` collection (#54224)

Closes #54168. This was accidentally removed from a code refactoring.
parent 803bbe5c
...@@ -84,6 +84,7 @@ import { PageNotFoundError } from '../../../shared/lib/utils' ...@@ -84,6 +84,7 @@ import { PageNotFoundError } from '../../../shared/lib/utils'
import { srcEmptySsgManifest } from '../../../build/webpack/plugins/build-manifest-plugin' import { srcEmptySsgManifest } from '../../../build/webpack/plugins/build-manifest-plugin'
import { PropagateToWorkersField } from './types' import { PropagateToWorkersField } from './types'
import { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin' import { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'
import { devPageFiles } from '../../../build/webpack/plugins/next-types-plugin/shared'
type SetupOpts = { type SetupOpts = {
dir: string dir: string
...@@ -815,6 +816,7 @@ async function startWatcher(opts: SetupOpts) { ...@@ -815,6 +816,7 @@ async function startWatcher(opts: SetupOpts) {
appFiles.clear() appFiles.clear()
pageFiles.clear() pageFiles.clear()
devPageFiles.clear()
const sortedKnownFiles: string[] = [...knownFiles.keys()].sort( const sortedKnownFiles: string[] = [...knownFiles.keys()].sort(
sortByPageExts(nextConfig.pageExtensions) sortByPageExts(nextConfig.pageExtensions)
...@@ -924,6 +926,9 @@ async function startWatcher(opts: SetupOpts) { ...@@ -924,6 +926,9 @@ async function startWatcher(opts: SetupOpts) {
continue continue
} }
// Collect all current filenames for the TS plugin to use
devPageFiles.add(fileName)
let pageName = absolutePathToPage(fileName, { let pageName = absolutePathToPage(fileName, {
dir: isAppPath ? appDir! : pagesDir!, dir: isAppPath ? appDir! : pagesDir!,
extensions: nextConfig.pageExtensions, extensions: nextConfig.pageExtensions,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment