@nx/webpack 17.3.0-beta.1 → 17.3.0-beta.2

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/webpack",
3
- "version": "17.3.0-beta.1",
3
+ "version": "17.3.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
6
6
  "repository": {
@@ -62,9 +62,9 @@
62
62
  "webpack-dev-server": "^4.9.3",
63
63
  "webpack-node-externals": "^3.0.0",
64
64
  "webpack-subresource-integrity": "^5.1.0",
65
- "@nx/devkit": "17.3.0-beta.1",
66
- "@nx/js": "17.3.0-beta.1",
67
- "@nrwl/webpack": "17.3.0-beta.1"
65
+ "@nx/devkit": "17.3.0-beta.2",
66
+ "@nx/js": "17.3.0-beta.2",
67
+ "@nrwl/webpack": "17.3.0-beta.2"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public"
@@ -17,8 +17,8 @@ const apply_web_config_1 = require("./lib/apply-web-config");
17
17
  */
18
18
  class NxWebpackPlugin {
19
19
  constructor(options = {}) {
20
- // If we're not in an Nx task, we're building inferred targets, so skip normalizing build options.
21
- if (process.env['NX_TASK_TARGET_PROJECT']) {
20
+ // If we're building inferred targets, skip normalizing build options.
21
+ if (!global.NX_GRAPH_CREATION) {
22
22
  this.options = (0, normalize_options_1.normalizeOptions)(options);
23
23
  }
24
24
  }
@@ -57,14 +57,16 @@ exports.createNodes = [
57
57
  ];
58
58
  async function createWebpackTargets(configFilePath, projectRoot, options, context) {
59
59
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
60
+ global.NX_GRAPH_CREATION = true;
60
61
  const webpackConfig = (0, resolve_user_defined_webpack_config_1.resolveUserDefinedWebpackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
62
+ delete global.NX_GRAPH_CREATION;
61
63
  const webpackOptions = await (0, read_webpack_options_1.readWebpackOptions)(webpackConfig);
62
64
  const outputPath = normalizeOutputPath(webpackOptions.output?.path) ??
63
65
  '{workspaceRoot}/dist/{projectRoot}';
64
66
  const targets = {};
65
67
  const configBasename = (0, path_1.basename)(configFilePath);
66
68
  targets[options.buildTargetName] = {
67
- command: `webpack -c ${configBasename} --node-env=production`,
69
+ command: `webpack-cli -c ${configBasename} --node-env=production`,
68
70
  options: { cwd: projectRoot },
69
71
  cache: true,
70
72
  dependsOn: [`^${options.buildTargetName}`],
@@ -86,13 +88,13 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
86
88
  outputs: [outputPath],
87
89
  };
88
90
  targets[options.serveTargetName] = {
89
- command: `webpack serve -c ${configBasename} --node-env=development`,
91
+ command: `webpack-cli serve -c ${configBasename} --node-env=development`,
90
92
  options: {
91
93
  cwd: projectRoot,
92
94
  },
93
95
  };
94
96
  targets[options.previewTargetName] = {
95
- command: `webpack serve -c ${configBasename} --node-env=production`,
97
+ command: `webpack-cli serve -c ${configBasename} --node-env=production`,
96
98
  options: {
97
99
  cwd: projectRoot,
98
100
  },