fix(nextjs): avoid path error on dev server creation (#21998)
This commit is contained in:
parent
8ccdd73c8b
commit
1961bb514e
@ -25,7 +25,8 @@ export default async function* serveExecutor(
|
|||||||
);
|
);
|
||||||
const projectRoot = context.workspace.projects[context.projectName].root;
|
const projectRoot = context.workspace.projects[context.projectName].root;
|
||||||
// This is required for the default custom server to work. See the @nx/next:app generator.
|
// This is required for the default custom server to work. See the @nx/next:app generator.
|
||||||
const nextDir = resolve(context.root, buildOptions.outputPath);
|
const nextDir =
|
||||||
|
!options.dev && resolve(context.root, buildOptions.outputPath);
|
||||||
process.env.NX_NEXT_DIR ??= options.dev ? projectRoot : nextDir;
|
process.env.NX_NEXT_DIR ??= options.dev ? projectRoot : nextDir;
|
||||||
|
|
||||||
if (options.customServerTarget) {
|
if (options.customServerTarget) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user