Skip to content

Commit 4770dfe

Browse files
committed
fix: include files with brackets, like /[id].js
1 parent 99ca449 commit 4770dfe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/runtime/src/helpers/functions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ export const getSSRLambdas = async (publish: string, baseDir: string): Promise<S
322322
]
323323
}
324324

325+
// TODO: check if there's any other glob specialties missing
326+
const escapeGlob = (path: string) => path.replace(/\[/g, '*').replace(/\]/g, '*')
327+
325328
const getSSRRoutes = async (publish: string): Promise<RouteConfig[]> => {
326329
const pages = (await readJSON(join(publish, 'server', 'pages-manifest.json'))) as Record<string, string>
327330
const routes = Object.entries(pages).filter(
@@ -335,7 +338,7 @@ const getSSRRoutes = async (publish: string): Promise<RouteConfig[]> => {
335338
const compiledPath = join(publish, 'server', compiled)
336339

337340
const routeDependencies = await getDependenciesOfFile(compiledPath)
338-
const includedFiles = [compiledPath, ...routeDependencies]
341+
const includedFiles = [compiledPath, ...routeDependencies].map(escapeGlob)
339342

340343
return {
341344
functionName,

0 commit comments

Comments
 (0)