@nx/webpack 20.3.1 → 20.4.0-beta.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "20.3.1",
3
+ "version": "20.4.0-beta.0",
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": {
@@ -65,8 +65,8 @@
65
65
  "webpack-dev-server": "^5.0.4",
66
66
  "webpack-node-externals": "^3.0.0",
67
67
  "webpack-subresource-integrity": "^5.1.0",
68
- "@nx/devkit": "20.3.1",
69
- "@nx/js": "20.3.1"
68
+ "@nx/devkit": "20.4.0-beta.0",
69
+ "@nx/js": "20.4.0-beta.0"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"
@@ -37,6 +37,16 @@ async function webpackInitGeneratorInternal(tree, schema) {
37
37
  'webpack-preview',
38
38
  'preview-webpack',
39
39
  ],
40
+ buildDepsTargetName: [
41
+ 'build-deps',
42
+ 'webpack:build-deps',
43
+ 'webpack-build-deps',
44
+ ],
45
+ watchDepsTargetName: [
46
+ 'watch-deps',
47
+ 'webpack:watch-deps',
48
+ 'webpack-watch-deps',
49
+ ],
40
50
  }, schema.updatePackageScripts);
41
51
  }
42
52
  let installTask = () => { };
@@ -4,6 +4,8 @@ export interface WebpackPluginOptions {
4
4
  serveTargetName?: string;
5
5
  serveStaticTargetName?: string;
6
6
  previewTargetName?: string;
7
+ buildDepsTargetName?: string;
8
+ watchDepsTargetName?: string;
7
9
  }
8
10
  /**
9
11
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
@@ -12,6 +12,7 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
12
12
  const path_1 = require("path");
13
13
  const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
14
14
  const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
15
+ const util_1 = require("@nx/js/src/plugins/typescript/util");
15
16
  const pmc = (0, devkit_1.getPackageManagerCommand)();
16
17
  function readTargetsCache(cachePath) {
17
18
  return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
@@ -173,6 +174,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
173
174
  '@nx/js:typescript-sync',
174
175
  ];
175
176
  }
177
+ (0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
176
178
  return { targets, metadata: {} };
177
179
  }
178
180
  function normalizeOutputPath(outputPath, projectRoot) {
@@ -209,5 +211,7 @@ function normalizeOptions(options) {
209
211
  serveTargetName: options?.serveTargetName ?? 'serve',
210
212
  serveStaticTargetName: options?.serveStaticTargetName ?? 'serve-static',
211
213
  previewTargetName: options?.previewTargetName ?? 'preview',
214
+ buildDepsTargetName: 'build-deps',
215
+ watchDepsTargetName: 'watch-deps',
212
216
  };
213
217
  }