@nx/webpack 17.2.8 → 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/README.md CHANGED
@@ -1,4 +1,9 @@
1
- <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
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 CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
2
7
 
3
8
  <div style="text-align: center;">
4
9
 
@@ -15,9 +20,9 @@
15
20
 
16
21
  <hr>
17
22
 
18
- # Nx: Smart, Fast and Extensible Build System
23
+ # Nx: Smart Monorepos · Fast CI
19
24
 
20
- Nx is a next generation build system with first class monorepo support and powerful integrations.
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
21
26
 
22
27
  This package is a [Webpack plugin for Nx](https://nx.dev/packages/webpack).
23
28
 
@@ -59,5 +64,5 @@ npx nx@latest init
59
64
  - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
60
65
 
61
66
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
62
- width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
67
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
63
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "17.2.8",
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.2.8",
66
- "@nx/js": "17.2.8",
67
- "@nrwl/webpack": "17.2.8"
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
  },