Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Nov 8, 2021
1 parent 1054bbf commit 6349ba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
15 changes: 6 additions & 9 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,9 @@ export default async function build(
'utf8'
)

const outputFileTracingRoot =
config.experimental.outputFileTracingRoot || dir

if (config.experimental.outputStandalone) {
await nextBuildSpan
.traceChild('copy-traced-files')
Expand All @@ -1373,7 +1376,7 @@ export default async function build(
dir,
distDir,
pageKeys,
config.experimental.outputFileTracingRoot || dir,
outputFileTracingRoot,
requiredServerFiles.config
)
})
Expand Down Expand Up @@ -1985,10 +1988,7 @@ export default async function build(
path.join(
distDir,
'standalone',
path.relative(
config.experimental.outputFileTracingRoot || dir,
filePath
)
path.relative(outputFileTracingRoot, filePath)
)
)
}
Expand All @@ -1997,10 +1997,7 @@ export default async function build(
path.join(
distDir,
'standalone',
path.relative(
config.experimental.outputFileTracingRoot || dir,
distDir
),
path.relative(outputFileTracingRoot, distDir),
SERVER_DIRECTORY,
'pages'
)
Expand Down
3 changes: 2 additions & 1 deletion packages/next/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,8 @@ export async function copyTracedFiles(
for (const page of pageKeys) {
const pageFile = path.join(
distDir,
'server/pages',
'server',
'pages',
`${normalizePagePath(page)}.js`
)
const pageTraceFile = `${pageFile}.nft.json`
Expand Down

0 comments on commit 6349ba3

Please sign in to comment.