Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/next/src/build/adapter/build-complete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,18 @@ export async function handleBuildComplete({
return {} as Record<string, string>
}
)

// If this is a parallel route we just need to merge
// the assets as they share the same pathname
const existingOutput = appOutputMap[normalizedPage]
if (existingOutput) {
Object.assign(existingOutput.assets, assets)
existingOutput.assets[path.relative(tracingRoot, pageFile)] =
pageFile

continue
}

const functionConfig =
functionsConfigManifest.functions[normalizedPage] || {}

Expand Down
3 changes: 3 additions & 0 deletions test/production/adapter-config/adapter-config-export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe('adapter-config export', () => {
'pages/api/node-pages.ts',
'pages/edge-pages/index.tsx',
'pages/node-pages/index.tsx',
'app/node-app/[slug]/page.tsx',
'app/node-app/@dialog/default.tsx',
'app/node-app/@dialog/[slug]/page.tsx',
]

for (const file of nonExportFiles) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Page() {
return (
<>
<p>@dialog parallel route for /node-app/[slug]</p>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return 'default dialog'
}
3 changes: 3 additions & 0 deletions test/production/adapter-config/app/node-app/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <>/node-app/[slug]</>
}
8 changes: 8 additions & 0 deletions test/production/adapter-config/app/node-app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function Layout({ dialog, children }: any) {
return (
<>
{dialog}
{children}
</>
)
}
1 change: 1 addition & 0 deletions test/production/adapter-config/my-adapter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import fs from 'fs'
const myAdapter = {
name: 'my-custom-adapter',
modifyConfig: (config, { phase }) => {
if (process.env.NODE_ENV !== 'production') return config
if (typeof phase !== 'string') {
throw new Error(`invalid phase value provided to modifyConfig ${phase}`)
}
Expand Down
Loading