@nx/next 23.3.0-beta.4 → 23.3.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,18 +131,27 @@ function getStartTargetConfig(namedInputs, options, projectRoot) {
131
131
  return targetConfig;
132
132
  }
133
133
  async function getOutputs(projectRoot, nextConfig) {
134
- let dir = '.next';
135
134
  const { PHASE_PRODUCTION_BUILD } = require('next/constants');
135
+ let resolvedConfig;
136
136
  if (typeof nextConfig === 'function') {
137
137
  // Works for both async and sync functions.
138
- const configResult = await Promise.resolve(nextConfig(PHASE_PRODUCTION_BUILD, { defaultConfig: {} }));
139
- if (configResult?.distDir) {
140
- dir = configResult?.distDir;
141
- }
138
+ resolvedConfig = await Promise.resolve(nextConfig(PHASE_PRODUCTION_BUILD, { defaultConfig: {} }));
139
+ }
140
+ else if (typeof nextConfig === 'object') {
141
+ resolvedConfig = nextConfig;
142
142
  }
143
- else if (typeof nextConfig === 'object' && nextConfig?.distDir) {
144
- // If nextConfig is an object, directly use its 'distDir' property.
145
- dir = nextConfig.distDir;
143
+ // Mirrors Next.js' own `hasCustomExportOutput` check. With `output: 'export'`,
144
+ // `next build` treats a custom `distDir` as the export directory and falls back
145
+ // to `out` otherwise, reusing `.next` internally for intermediate artifacts.
146
+ let dir;
147
+ if (resolvedConfig?.output === 'export') {
148
+ dir =
149
+ resolvedConfig.distDir && resolvedConfig.distDir !== '.next'
150
+ ? resolvedConfig.distDir
151
+ : 'out';
152
+ }
153
+ else {
154
+ dir = resolvedConfig?.distDir || '.next';
146
155
  }
147
156
  if (projectRoot === '.') {
148
157
  return `{projectRoot}/${dir}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "23.3.0-beta.4",
3
+ "version": "23.3.0-beta.5",
4
4
  "private": false,
5
5
  "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Playwright, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "peerDependencies": {
70
70
  "next": ">=14.0.0 <17.0.0",
71
- "@nx/webpack": "23.3.0-beta.4"
71
+ "@nx/webpack": "23.3.0-beta.5"
72
72
  },
73
73
  "peerDependenciesMeta": {
74
74
  "@nx/webpack": {
@@ -76,26 +76,26 @@
76
76
  }
77
77
  },
78
78
  "dependencies": {
79
+ "@nx/devkit": "23.3.0-beta.5",
79
80
  "@babel/plugin-proposal-decorators": "^7.22.7",
80
81
  "copy-webpack-plugin": "^14.0.0",
81
82
  "ignore": "^7.0.5",
82
83
  "semver": "^7.6.3",
83
84
  "tslib": "^2.3.0",
84
85
  "webpack-merge": "^5.8.0",
85
- "@phenomnomnominal/tsquery": "~6.2.0",
86
- "@nx/devkit": "23.3.0-beta.4",
87
- "@nx/js": "23.3.0-beta.4",
88
- "@nx/eslint": "23.3.0-beta.4",
89
- "@nx/web": "23.3.0-beta.4",
90
- "@nx/react": "23.3.0-beta.4"
86
+ "@nx/js": "23.3.0-beta.5",
87
+ "@nx/eslint": "23.3.0-beta.5",
88
+ "@nx/react": "23.3.0-beta.5",
89
+ "@nx/web": "23.3.0-beta.5",
90
+ "@phenomnomnominal/tsquery": "~6.2.0"
91
91
  },
92
92
  "devDependencies": {
93
+ "@nx/cypress": "23.3.0-beta.5",
94
+ "@nx/playwright": "23.3.0-beta.5",
95
+ "@nx/vitest": "23.3.0-beta.5",
96
+ "@nx/webpack": "23.3.0-beta.5",
93
97
  "next": "15.5.25",
94
- "@nx/cypress": "23.3.0-beta.4",
95
- "@nx/playwright": "23.3.0-beta.4",
96
- "@nx/vitest": "23.3.0-beta.4",
97
- "@nx/webpack": "23.3.0-beta.4",
98
- "nx": "23.3.0-beta.4"
98
+ "nx": "23.3.0-beta.5"
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public"
@@ -0,0 +1,18 @@
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ {{links}}
9
+
10
+ <hr>
11
+
12
+ # Nx: Smart Monorepos · Fast Builds
13
+
14
+ Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
15
+
16
+ This package is a [Next.js plugin for Nx](https://nx.dev/next/overview).
17
+
18
+ {{content}}