@nx/node 21.3.0-beta.6 → 21.3.0-canary.20250613-18155f4
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.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/node",
|
3
|
-
"version": "21.3.0-
|
3
|
+
"version": "21.3.0-canary.20250613-18155f4",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Node Plugin for Nx contains generators to manage Node applications within an Nx workspace.",
|
6
6
|
"repository": {
|
@@ -32,10 +32,10 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"tslib": "^2.3.0",
|
35
|
-
"@nx/devkit": "21.3.0-
|
36
|
-
"@nx/jest": "21.3.0-
|
37
|
-
"@nx/js": "21.3.0-
|
38
|
-
"@nx/eslint": "21.3.0-
|
35
|
+
"@nx/devkit": "21.3.0-canary.20250613-18155f4",
|
36
|
+
"@nx/jest": "21.3.0-canary.20250613-18155f4",
|
37
|
+
"@nx/js": "21.3.0-canary.20250613-18155f4",
|
38
|
+
"@nx/eslint": "21.3.0-canary.20250613-18155f4",
|
39
39
|
"tcp-port-used": "^1.0.2",
|
40
40
|
"kill-port": "^1.6.1"
|
41
41
|
},
|
@@ -15,12 +15,12 @@ function addProject(tree, options) {
|
|
15
15
|
};
|
16
16
|
if (options.bundler === 'esbuild') {
|
17
17
|
(0, target_defaults_utils_1.addBuildTargetDefaults)(tree, '@nx/esbuild:esbuild');
|
18
|
-
project.targets.build = (0, create_targets_1.getEsBuildConfig)(
|
18
|
+
project.targets.build = (0, create_targets_1.getEsBuildConfig)(project, options);
|
19
19
|
}
|
20
20
|
else if (options.bundler === 'webpack') {
|
21
21
|
if (!(0, has_webpack_plugin_1.hasWebpackPlugin)(tree) && options.addPlugin === false) {
|
22
22
|
(0, target_defaults_utils_1.addBuildTargetDefaults)(tree, `@nx/webpack:webpack`);
|
23
|
-
project.targets.build = (0, create_targets_1.getWebpackBuildConfig)(
|
23
|
+
project.targets.build = (0, create_targets_1.getWebpackBuildConfig)(project, options);
|
24
24
|
}
|
25
25
|
else if (options.isNest) {
|
26
26
|
// If we are using Nest that has the webpack plugin we need to override the
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ProjectConfiguration,
|
1
|
+
import { ProjectConfiguration, TargetConfiguration } from '@nx/devkit';
|
2
2
|
import { NormalizedSchema } from './normalized-schema';
|
3
|
-
export declare function getWebpackBuildConfig(
|
4
|
-
export declare function getEsBuildConfig(
|
3
|
+
export declare function getWebpackBuildConfig(project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
|
4
|
+
export declare function getEsBuildConfig(project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
|
5
5
|
export declare function getServeConfig(options: NormalizedSchema): TargetConfiguration;
|
6
6
|
export declare function getNestWebpackBuildConfig(): TargetConfiguration;
|
@@ -5,9 +5,7 @@ exports.getEsBuildConfig = getEsBuildConfig;
|
|
5
5
|
exports.getServeConfig = getServeConfig;
|
6
6
|
exports.getNestWebpackBuildConfig = getNestWebpackBuildConfig;
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
8
|
-
|
9
|
-
function getWebpackBuildConfig(tree, project, options) {
|
10
|
-
const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
8
|
+
function getWebpackBuildConfig(project, options) {
|
11
9
|
return {
|
12
10
|
executor: `@nx/webpack:webpack`,
|
13
11
|
outputs: ['{options.outputPath}'],
|
@@ -16,9 +14,9 @@ function getWebpackBuildConfig(tree, project, options) {
|
|
16
14
|
target: 'node',
|
17
15
|
compiler: 'tsc',
|
18
16
|
outputPath: options.outputPath,
|
19
|
-
main: (0, devkit_1.joinPathFragments)(sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
|
17
|
+
main: (0, devkit_1.joinPathFragments)(project.sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
|
20
18
|
tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
21
|
-
assets: [(0, devkit_1.joinPathFragments)(sourceRoot, 'assets')],
|
19
|
+
assets: [(0, devkit_1.joinPathFragments)(project.sourceRoot, 'assets')],
|
22
20
|
webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
|
23
21
|
generatePackageJson: options.isUsingTsSolutionConfig ? undefined : true,
|
24
22
|
},
|
@@ -32,8 +30,7 @@ function getWebpackBuildConfig(tree, project, options) {
|
|
32
30
|
},
|
33
31
|
};
|
34
32
|
}
|
35
|
-
function getEsBuildConfig(
|
36
|
-
const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
33
|
+
function getEsBuildConfig(project, options) {
|
37
34
|
return {
|
38
35
|
executor: '@nx/esbuild:esbuild',
|
39
36
|
outputs: ['{options.outputPath}'],
|
@@ -44,9 +41,9 @@ function getEsBuildConfig(tree, project, options) {
|
|
44
41
|
// Use CJS for Node apps for widest compatibility.
|
45
42
|
format: ['cjs'],
|
46
43
|
bundle: false,
|
47
|
-
main: (0, devkit_1.joinPathFragments)(sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
|
44
|
+
main: (0, devkit_1.joinPathFragments)(project.sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
|
48
45
|
tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
49
|
-
assets: [(0, devkit_1.joinPathFragments)(sourceRoot, 'assets')],
|
46
|
+
assets: [(0, devkit_1.joinPathFragments)(project.sourceRoot, 'assets')],
|
50
47
|
generatePackageJson: options.isUsingTsSolutionConfig ? undefined : true,
|
51
48
|
esbuildOptions: {
|
52
49
|
sourcemap: true,
|
@@ -96,11 +93,11 @@ function getNestWebpackBuildConfig() {
|
|
96
93
|
executor: 'nx:run-commands',
|
97
94
|
options: {
|
98
95
|
command: 'webpack-cli build',
|
99
|
-
args: ['
|
96
|
+
args: ['node-env=production'],
|
100
97
|
},
|
101
98
|
configurations: {
|
102
99
|
development: {
|
103
|
-
args: ['
|
100
|
+
args: ['node-env=development'],
|
104
101
|
},
|
105
102
|
},
|
106
103
|
};
|
@@ -19,16 +19,15 @@ async function normalizeOptions(host, options) {
|
|
19
19
|
? options.tags.split(',').map((s) => s.trim())
|
20
20
|
: [];
|
21
21
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
22
|
-
const addPlugin =
|
23
|
-
|
24
|
-
nxJson.useInferencePlugins !== false);
|
22
|
+
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
23
|
+
nxJson.useInferencePlugins !== false;
|
25
24
|
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
26
25
|
const swcJest = options.swcJest ?? isUsingTsSolutionConfig;
|
27
26
|
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
28
27
|
const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
|
29
28
|
return {
|
30
|
-
...options,
|
31
29
|
addPlugin,
|
30
|
+
...options,
|
32
31
|
name: appProjectName,
|
33
32
|
frontendProject: options.frontendProject
|
34
33
|
? (0, devkit_1.names)(options.frontendProject).fileName
|