Skip to content

Commit c5008a4

Browse files
authored
fix: bundle edge chunks with lambda (#152)
1 parent e95f9c0 commit c5008a4

File tree

10 files changed

+756
-4
lines changed

10 files changed

+756
-4
lines changed

src/build/content/server.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise<void> => {
1313
const srcDir = join(ctx.publishDir, 'standalone/.next')
1414
const destDir = join(ctx.serverHandlerDir, '.next')
1515

16-
const paths = await glob([`*`, `server/*`, `server/chunks/*`, `server/+(app|pages)/**/*.js`], {
17-
cwd: srcDir,
18-
extglob: true,
19-
})
16+
const paths = await glob(
17+
[`*`, `server/*`, `server/chunks/*`, `server/edge-chunks/*`, `server/+(app|pages)/**/*.js`],
18+
{
19+
cwd: srcDir,
20+
extglob: true,
21+
},
22+
)
2023

2124
await Promise.all(
2225
paths.map(async (path: string) => {
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ImageResponse } from '@vercel/og'
2+
3+
export async function GET() {
4+
return new ImageResponse(<div>hi</div>, {
5+
width: 1200,
6+
height: 630,
7+
})
8+
}

tests/fixtures/wasm/app/og/route.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ImageResponse } from '@vercel/og'
2+
3+
export async function GET() {
4+
return new ImageResponse(<div>hi</div>, {
5+
width: 1200,
6+
height: 630,
7+
})
8+
}
9+
10+
export const runtime = 'edge'

tests/fixtures/wasm/next.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('next').NextConfig} */
2+
module.exports = {
3+
output: 'standalone',
4+
eslint: {
5+
ignoreDuringBuilds: true,
6+
},
7+
}

0 commit comments

Comments
 (0)