@nx/node 21.3.0-canary.20250710-13551c9 → 21.3.0-canary.20250711-be6d35b

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-canary.20250710-13551c9",
3
+ "version": "21.3.0-canary.20250711-be6d35b",
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-canary.20250710-13551c9",
36
- "@nx/jest": "21.3.0-canary.20250710-13551c9",
37
- "@nx/js": "21.3.0-canary.20250710-13551c9",
38
- "@nx/eslint": "21.3.0-canary.20250710-13551c9",
35
+ "@nx/devkit": "21.3.0-canary.20250711-be6d35b",
36
+ "@nx/jest": "21.3.0-canary.20250711-be6d35b",
37
+ "@nx/js": "21.3.0-canary.20250711-be6d35b",
38
+ "@nx/eslint": "21.3.0-canary.20250711-be6d35b",
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)(project, options);
18
+ project.targets.build = (0, create_targets_1.getEsBuildConfig)(tree, 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)(project, options);
23
+ project.targets.build = (0, create_targets_1.getWebpackBuildConfig)(tree, 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, TargetConfiguration } from '@nx/devkit';
1
+ import { ProjectConfiguration, Tree, TargetConfiguration } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalized-schema';
3
- export declare function getWebpackBuildConfig(project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
4
- export declare function getEsBuildConfig(project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
3
+ export declare function getWebpackBuildConfig(tree: Tree, project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
4
+ export declare function getEsBuildConfig(tree: Tree, project: ProjectConfiguration, options: NormalizedSchema): TargetConfiguration;
5
5
  export declare function getServeConfig(options: NormalizedSchema): TargetConfiguration;
6
6
  export declare function getNestWebpackBuildConfig(): TargetConfiguration;
@@ -5,7 +5,9 @@ exports.getEsBuildConfig = getEsBuildConfig;
5
5
  exports.getServeConfig = getServeConfig;
6
6
  exports.getNestWebpackBuildConfig = getNestWebpackBuildConfig;
7
7
  const devkit_1 = require("@nx/devkit");
8
- function getWebpackBuildConfig(project, options) {
8
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
+ function getWebpackBuildConfig(tree, project, options) {
10
+ const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
9
11
  return {
10
12
  executor: `@nx/webpack:webpack`,
11
13
  outputs: ['{options.outputPath}'],
@@ -14,9 +16,9 @@ function getWebpackBuildConfig(project, options) {
14
16
  target: 'node',
15
17
  compiler: 'tsc',
16
18
  outputPath: options.outputPath,
17
- main: (0, devkit_1.joinPathFragments)(project.sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
19
+ main: (0, devkit_1.joinPathFragments)(sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
18
20
  tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
19
- assets: [(0, devkit_1.joinPathFragments)(project.sourceRoot, 'assets')],
21
+ assets: [(0, devkit_1.joinPathFragments)(sourceRoot, 'assets')],
20
22
  webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
21
23
  generatePackageJson: options.isUsingTsSolutionConfig ? undefined : true,
22
24
  },
@@ -30,7 +32,8 @@ function getWebpackBuildConfig(project, options) {
30
32
  },
31
33
  };
32
34
  }
33
- function getEsBuildConfig(project, options) {
35
+ function getEsBuildConfig(tree, project, options) {
36
+ const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
34
37
  return {
35
38
  executor: '@nx/esbuild:esbuild',
36
39
  outputs: ['{options.outputPath}'],
@@ -41,9 +44,9 @@ function getEsBuildConfig(project, options) {
41
44
  // Use CJS for Node apps for widest compatibility.
42
45
  format: ['cjs'],
43
46
  bundle: false,
44
- main: (0, devkit_1.joinPathFragments)(project.sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
47
+ main: (0, devkit_1.joinPathFragments)(sourceRoot, 'main' + (options.js ? '.js' : '.ts')),
45
48
  tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
46
- assets: [(0, devkit_1.joinPathFragments)(project.sourceRoot, 'assets')],
49
+ assets: [(0, devkit_1.joinPathFragments)(sourceRoot, 'assets')],
47
50
  generatePackageJson: options.isUsingTsSolutionConfig ? undefined : true,
48
51
  esbuildOptions: {
49
52
  sourcemap: true,