| |
| new file mode 100644 |
| |
| |
| |
| @@ -0,0 +1,8 @@ |
| +export default function robots() { |
| + return { |
| + rules: { |
| + userAgent: '*', |
| + allow: '/', |
| + }, |
| + } |
| +} |
| |
| new file mode 100644 |
| |
| |
| |
| @@ -0,0 +1,3 @@ |
| +export default function sitemap() { |
| + return [{ url: 'https://example.com' }] |
| +} |
| |
| |
| |
| |
| @@ -1,4 +1,6 @@ |
| /** @type {import('next').NextConfig} */ |
| -const nextConfig = {} |
| +const nextConfig = { |
| + pageExtensions: ['metadata.ts', 'js', 'jsx', 'ts', 'tsx'], |
| +} |
| |
| module.exports = nextConfig |
| |
| new file mode 100644 |
| |
| |
| |
| @@ -0,0 +1,26 @@ |
| +import path from 'path' |
| +import { nextTestSetup } from 'e2e-utils' |
| + |
| +describe('debug-build-paths metadata routes', () => { |
| + const { next } = nextTestSetup({ |
| + files: path.join(__dirname, 'fixtures/default'), |
| + skipStart: true, |
| + env: { |
| + __NEXT_PRIVATE_DETERMINISTIC_BUILD_OUTPUT: '1', |
| + }, |
| + }) |
| + |
| + it('selectively builds App Router metadata routes', async () => { |
| + const result = await next.build({ |
| + args: [ |
| + '--debug-build-paths', |
| + 'app/robots.metadata.ts,app/sitemap.metadata.ts', |
| + ], |
| + }) |
| + |
| + expect(result.exitCode).toBe(0) |
| + expect(result.cliOutput).toContain('/robots.txt') |
| + expect(result.cliOutput).toContain('/sitemap.xml') |
| + expect(result.cliOutput).not.toContain('/about') |
| + }) |
| +}) |
| |
| new file mode 100644 |
| |
| |
| |
| @@ -0,0 +1,23 @@ |
| +import path from 'path' |
| +import { nextTestSetup } from 'e2e-utils' |
| + |
| +describe('debug-build-paths page route regression', () => { |
| + const { next } = nextTestSetup({ |
| + files: path.join(__dirname, 'fixtures/default'), |
| + skipStart: true, |
| + env: { |
| + __NEXT_PRIVATE_DETERMINISTIC_BUILD_OUTPUT: '1', |
| + }, |
| + }) |
| + |
| + it('continues to selectively build a regular App Router page', async () => { |
| + const result = await next.build({ |
| + args: ['--debug-build-paths', 'app/about/page.tsx'], |
| + }) |
| + |
| + expect(result.exitCode).toBe(0) |
| + expect(result.cliOutput).toContain('/about') |
| + expect(result.cliOutput).not.toContain('/robots.txt') |
| + expect(result.cliOutput).not.toContain('/sitemap.xml') |
| + }) |
| +}) |
|
|