Skip to content

Commit

Permalink
fix(nextjs): When running dev server .next folder should be in source (
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed Dec 4, 2023
1 parent 84274dd commit e12050b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/next/plugins/with-nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ function withNx(
context: WithNxContext = getWithNxContext()
): NextConfigFn {
return async (phase: string) => {
const { PHASE_PRODUCTION_SERVER } = await import('next/constants');
if (phase === PHASE_PRODUCTION_SERVER) {
const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = await import(
'next/constants'
);
if ([PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER].includes(phase)) {
// If we are running an already built production server, just return the configuration.
// NOTE: Avoid any `require(...)` or `import(...)` statements here. Development dependencies are not available at production runtime.
const { nx, ...validNextConfig } = _nextConfig;
Expand Down

0 comments on commit e12050b

Please sign in to comment.