next.js
85a77c4c - turbopack: Fix pageExtensions with dots (#58504)

Commit
2 years ago
turbopack: Fix pageExtensions with dots (#58504) ### What? Fixes finding Page/App pages when using a `pageExtension` that itself contains a `.`. Eg, `pages/index.page.js` should match as a Page when using `pageExtensions: ["page.js"]` ### Why? Matching webpack configurations. ### How? We split in reverse direction, meaning we'd have a `(basename, ext)` of `('index.page', 'js')`. Webpack [uses forward splitting](https://github.com/vercel/next.js/blob/9ab8828f72e96f5de86a7c50b67a1c5abe6e146c/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts#L27-L31), giving a proper `('index', 'page.js')`. Closes PACK-1970 Fixes https://github.com/vercel/turbo/issues/6106 Fixes https://github.com/vercel/next.js/issues/57603
Author
Parents
Loading