Skip to content

Commit

Permalink
fix(nextjs): set NODE_ENV for the serve command
Browse files Browse the repository at this point in the history
ISSUES CLOSED: nrwl#5627
  • Loading branch information
Boris Zubchenko authored and kirjai committed Jun 25, 2021
1 parent 7510ee4 commit 2ba13db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export default async function* serveExecutor(
options: NextServeBuilderOptions,
context: ExecutorContext
) {
process.env.NODE_ENV = process.env.NODE_ENV
? process.env.NODE_ENV
: options.dev
? 'development'
: 'production';
let dependencies: DependentBuildableProjectNode[] = [];
const buildTarget = parseTargetString(options.buildTarget);
const baseUrl = `http://${options.hostname || 'localhost'}:${options.port}`;
Expand Down

0 comments on commit 2ba13db

Please sign in to comment.