@nx/node 20.2.0-canary.20241128-8eb6159 → 20.2.0-canary.20241130-ec5a5e6

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/node",
3
- "version": "20.2.0-canary.20241128-8eb6159",
3
+ "version": "20.2.0-canary.20241130-ec5a5e6",
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": "20.2.0-canary.20241128-8eb6159",
36
- "@nx/jest": "20.2.0-canary.20241128-8eb6159",
37
- "@nx/js": "20.2.0-canary.20241128-8eb6159",
38
- "@nx/eslint": "20.2.0-canary.20241128-8eb6159"
35
+ "@nx/devkit": "20.2.0-canary.20241130-ec5a5e6",
36
+ "@nx/jest": "20.2.0-canary.20241130-ec5a5e6",
37
+ "@nx/js": "20.2.0-canary.20241130-ec5a5e6",
38
+ "@nx/eslint": "20.2.0-canary.20241130-ec5a5e6"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -98,6 +98,20 @@ function getServeConfig(options) {
98
98
  },
99
99
  };
100
100
  }
101
+ function getNestWebpackBuildConfig() {
102
+ return {
103
+ executor: 'nx:run-commands',
104
+ options: {
105
+ command: 'webpack-cli build',
106
+ args: ['node-env=production'],
107
+ },
108
+ configurations: {
109
+ development: {
110
+ args: ['node-env=development'],
111
+ },
112
+ },
113
+ };
114
+ }
101
115
  function addProject(tree, options) {
102
116
  const project = {
103
117
  root: options.appProjectRoot,
@@ -115,6 +129,11 @@ function addProject(tree, options) {
115
129
  (0, target_defaults_utils_1.addBuildTargetDefaults)(tree, `@nx/webpack:webpack`);
116
130
  project.targets.build = getWebpackBuildConfig(project, options);
117
131
  }
132
+ else if (options.isNest) {
133
+ // If we are using Nest that has the webpack plugin we need to override the
134
+ // build target so that node-env can be set to production or development so the serve target can be run in development mode
135
+ project.targets.build = getNestWebpackBuildConfig();
136
+ }
118
137
  }
119
138
  project.targets.serve = getServeConfig(options);
120
139
  (0, devkit_1.addProjectConfiguration)(tree, options.name, project, options.standaloneConfig);