-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We can now support `next export` for `appDir` because of the new config added in #46744. fixes NEXT-775 ([NEXT-775](https://linear.app/vercel/issue/NEXT-775))
- Loading branch information
Showing
18 changed files
with
396 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test/integration/app-dir-export/app/another/[slug]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Link from 'next/link' | ||
|
||
export const dynamic = 'force-static' | ||
|
||
export function generateStaticParams() { | ||
return [{ slug: 'first' }, { slug: 'second' }] | ||
} | ||
|
||
export default function Page({ params }) { | ||
return ( | ||
<main> | ||
<h1>{params.slug}</h1> | ||
<ul> | ||
<li> | ||
<Link href="/another">Visit another page</Link> | ||
</li> | ||
</ul> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Another() { | ||
return ( | ||
<main> | ||
<h1>Another</h1> | ||
<ul> | ||
<li> | ||
<Link href="/">Visit the home page</Link> | ||
</li> | ||
<li> | ||
<Link href="/another">another page</Link> | ||
</li> | ||
<li> | ||
<Link href="/another/first">another first page</Link> | ||
</li> | ||
<li> | ||
<Link href="/another/second">another second page</Link> | ||
</li> | ||
<li> | ||
<Link href="/image-import">image import page</Link> | ||
</li> | ||
</ul> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export async function GET() { | ||
return Response.json({ answer: 42 }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export async function GET() { | ||
return new Response('this is plain text') | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Link from 'next/link' | ||
import img from './test.png' | ||
|
||
export default function ImageImport() { | ||
return ( | ||
<main> | ||
<h1>Image Import</h1> | ||
<ul> | ||
<li> | ||
<Link href="/">Visit the home page</Link> | ||
</li> | ||
<li> | ||
<a href={img.src}>View the image</a> | ||
</li> | ||
</ul> | ||
</main> | ||
) | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function RootLayout({ children }) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Home() { | ||
return ( | ||
<main> | ||
<h1>Home</h1> | ||
<ul> | ||
<li> | ||
<Link href="/another">another no trailingslash</Link> | ||
</li> | ||
<li> | ||
<Link href="/another/">another has trailingslash</Link> | ||
</li> | ||
<li> | ||
<Link href="/another/first">another first page</Link> | ||
</li> | ||
<li> | ||
<Link href="/another/second">another second page</Link> | ||
</li> | ||
<li> | ||
<Link href="/image-import">image import page</Link> | ||
</li> | ||
</ul> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Allow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'export', | ||
trailingSlash: true, | ||
experimental: { | ||
appDir: true, | ||
}, | ||
generateBuildId() { | ||
return 'test-build-id' | ||
}, | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.