From 1389fc0dabedf89e8d910ccd9a31258d3e51f0dc Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Tue, 24 Oct 2023 14:43:57 -0600 Subject: [PATCH] fix(nextjs): Custom server should work on fresh applications (#19833) --- packages/next/plugins/with-nx.ts | 2 +- packages/next/src/generators/custom-server/custom-server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/plugins/with-nx.ts b/packages/next/plugins/with-nx.ts index 3d6636eeb3184..63e90bc413b59 100644 --- a/packages/next/plugins/with-nx.ts +++ b/packages/next/plugins/with-nx.ts @@ -239,7 +239,7 @@ function withNx( const userWebpackConfig = nextConfig.webpack; - const { createWebpackConfig } = require('../src/utils/config'); + const { createWebpackConfig } = require('@nx/next/src/utils/config'); nextConfig.webpack = (a, b) => createWebpackConfig( workspaceRoot, diff --git a/packages/next/src/generators/custom-server/custom-server.ts b/packages/next/src/generators/custom-server/custom-server.ts index 5d10feff102d6..3e84f272cf8c3 100644 --- a/packages/next/src/generators/custom-server/custom-server.ts +++ b/packages/next/src/generators/custom-server/custom-server.ts @@ -81,7 +81,7 @@ export async function customServerGenerator( project.targets['serve-custom-server'] = { executor: '@nx/js:node', - defaultConfiguration: 'development', + defaultConfiguration: 'production', options: { buildTarget: `${options.project}:build-custom-server`, },