(root: string, routeFiles: readonly string[])
| 29 | * anywhere else is an ordinary module. |
| 30 | */ |
| 31 | export function nextProxyDir(root: string, routeFiles: readonly string[]): string { |
| 32 | for (const dir of ['pages/', 'app/']) { |
| 33 | if (routeFiles.some((file) => file.startsWith(root + dir))) return root; |
| 34 | if (routeFiles.some((file) => file.startsWith(`${root}src/${dir}`))) return `${root}src/`; |
| 35 | } |
| 36 | return root; |
| 37 | } |
| 38 | |
| 39 | /** Whether the app's manifest, or failing that the repository's, pins `next` below 16, where `proxy` isn't a convention yet. */ |
| 40 | function pinsNextBefore16(context: ResolutionContext, root: string): boolean { |
no outgoing calls
no test coverage detected