fix(nextjs): incorrect path when serving production builds (#14553)

closed https://github.com/nrwl/nx/issues/14507
This commit is contained in:
Nicholas Cunningham 2023-01-23 09:56:18 -07:00 committed by GitHub
parent d43d6b6de9
commit 578f5c03e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,10 @@ export default async function* serveExecutor(
parseTargetString(options.buildTarget, context.projectGraph),
context
);
const root = resolve(context.root, buildOptions.root);
const root = resolve(
context.root,
options.dev ? buildOptions.root : buildOptions.outputPath
);
const config = await prepareConfig(
options.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,
buildOptions,