Skip to content

Commit

Permalink
fix(nextjs): builder should work with pnp (#18325)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Jul 27, 2023
1 parent 01ef42b commit 1363bae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/next/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dotenv/config';
import {
ExecutorContext,
getPackageManagerCommand,
logger,
readJsonFile,
writeJsonFile,
Expand Down Expand Up @@ -53,11 +54,11 @@ export default async function buildExecutor(
process.env.NX_NEXT_OUTPUT_PATH ??= outputPath;

const args = createCliOptions({ experimentalAppOnly, profile, debug });
const command = `npx next build ${args.join(' ')}`;
const pm = getPackageManagerCommand();
const command = `${pm.exec} next build ${projectRoot} ${args.join(' ')}`;
const execSyncOptions: ExecSyncOptions = {
stdio: 'inherit',
encoding: 'utf-8',
cwd: projectRoot,
};
try {
execSync(command, execSyncOptions);
Expand Down

1 comment on commit 1363bae

@vercel
Copy link

@vercel vercel bot commented on 1363bae Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.