Skip to content

Commit

Permalink
fix(nextjs): move next/constants from top-level import to when it i…
Browse files Browse the repository at this point in the history
…s needed (#21612)

(cherry picked from commit 44d33c2)
  • Loading branch information
jaysoo authored and FrozenPandaz committed Feb 5, 2024
1 parent 1fe809f commit 8dd1db2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { existsSync, readdirSync } from 'fs';

import { projectGraphCacheDirectory } from 'nx/src/utils/cache-directory';
import { calculateHashForCreateNodes } from '@nx/devkit/src/utils/calculate-hash-for-create-nodes';
import { PHASE_PRODUCTION_BUILD } from 'next/constants';
import { getLockFileName } from '@nx/js';

export interface NextPluginOptions {
Expand Down Expand Up @@ -155,6 +154,7 @@ function getStartTargetConfig(options: NextPluginOptions, projectRoot: string) {

async function getOutputs(projectRoot, nextConfig) {
let dir = '.next';
const { PHASE_PRODUCTION_BUILD } = require('next/constants');

if (typeof nextConfig === 'function') {
// Works for both async and sync functions.
Expand Down

0 comments on commit 8dd1db2

Please sign in to comment.