@nx/webpack 23.0.0-beta.22 → 23.0.0-beta.24

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.
Files changed (234) hide show
  1. package/{app-plugin.d.ts → dist/app-plugin.d.ts} +0 -1
  2. package/{index.d.ts → dist/index.d.ts} +0 -1
  3. package/dist/internal.d.ts +8 -0
  4. package/dist/internal.js +26 -0
  5. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  6. package/{src → dist/src}/executors/dev-server/dev-server.impl.d.ts +0 -1
  7. package/{src → dist/src}/executors/dev-server/dev-server.impl.js +4 -4
  8. package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.d.ts +0 -1
  9. package/{src → dist/src}/executors/dev-server/lib/serve-path.d.ts +0 -1
  10. package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts +0 -1
  11. package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.d.ts +0 -1
  12. package/{src → dist/src}/executors/webpack/lib/normalize-options.d.ts +0 -1
  13. package/{src → dist/src}/executors/webpack/lib/run-webpack.d.ts +1 -2
  14. package/{src → dist/src}/executors/webpack/lib/run-webpack.js +3 -3
  15. package/{src → dist/src}/executors/webpack/webpack.impl.d.ts +0 -1
  16. package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
  17. package/{src → dist/src}/generators/configuration/configuration.js +2 -0
  18. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts +0 -1
  19. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.js +2 -0
  20. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.d.ts +0 -1
  21. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.d.ts +0 -1
  22. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/utils.d.ts +0 -1
  23. package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/validate-project.d.ts +0 -1
  24. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  25. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +1 -0
  26. package/{src → dist/src}/generators/convert-to-inferred/utils/ast.d.ts +0 -1
  27. package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts +0 -1
  28. package/{src → dist/src}/generators/convert-to-inferred/utils/index.d.ts +0 -1
  29. package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts +0 -1
  30. package/{src → dist/src}/generators/convert-to-inferred/utils/types.d.ts +0 -1
  31. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  32. package/{src → dist/src}/generators/init/init.js +8 -1
  33. package/{src → dist/src}/generators/init/schema.json +1 -1
  34. package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.d.ts +0 -1
  35. package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.d.ts +0 -1
  36. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
  37. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +134 -0
  38. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
  39. package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.d.ts +0 -1
  40. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
  41. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +225 -0
  42. package/{src → dist/src}/plugins/generate-package-json-plugin.d.ts +0 -1
  43. package/{src → dist/src}/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.d.ts +0 -1
  44. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-base-config.d.ts +0 -1
  45. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts +0 -1
  46. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/compiler-loaders.d.ts +0 -1
  47. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.d.ts +0 -1
  48. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.d.ts +0 -1
  49. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/normalize-options.d.ts +0 -1
  50. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/stylesheet-loaders.d.ts +0 -1
  51. package/{src → dist/src}/plugins/nx-webpack-plugin/lib/utils.d.ts +0 -1
  52. package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts +0 -1
  53. package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin.d.ts +0 -1
  54. package/{src → dist/src}/plugins/plugin.d.ts +3 -4
  55. package/{src → dist/src}/plugins/plugin.js +3 -3
  56. package/{src → dist/src}/plugins/stats-json-plugin.d.ts +0 -1
  57. package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts +0 -1
  58. package/{src → dist/src}/plugins/webpack-nx-build-coordination-plugin.d.ts +0 -1
  59. package/{src → dist/src}/plugins/write-index-html-plugin.d.ts +0 -1
  60. package/{src → dist/src}/utils/config.d.ts +12 -1
  61. package/{src → dist/src}/utils/config.js +15 -0
  62. package/{src → dist/src}/utils/create-copy-plugin.d.ts +0 -1
  63. package/{src → dist/src}/utils/deprecation.d.ts +3 -1
  64. package/{src → dist/src}/utils/deprecation.js +31 -1
  65. package/{src → dist/src}/utils/e2e-web-server-info-utils.d.ts +0 -1
  66. package/{src → dist/src}/utils/ensure-dependencies.d.ts +0 -1
  67. package/{src → dist/src}/utils/ensure-dependencies.js +1 -1
  68. package/{src → dist/src}/utils/fs.d.ts +0 -1
  69. package/{src → dist/src}/utils/get-client-environment.d.ts +0 -1
  70. package/{src → dist/src}/utils/get-css-module-local-ident.d.ts +0 -1
  71. package/{src → dist/src}/utils/has-plugin.d.ts +0 -1
  72. package/{src → dist/src}/utils/hash-format.d.ts +0 -1
  73. package/{src → dist/src}/utils/models.d.ts +0 -1
  74. package/{src → dist/src}/utils/run-webpack.d.ts +0 -1
  75. package/dist/src/utils/versions.d.ts +12 -0
  76. package/dist/src/utils/versions.js +24 -0
  77. package/dist/src/utils/web-babel-loader.d.ts +1 -0
  78. package/{src → dist/src}/utils/web-babel-loader.js +2 -0
  79. package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.d.ts +0 -1
  80. package/{src → dist/src}/utils/webpack/normalize-entry.d.ts +0 -1
  81. package/{src → dist/src}/utils/webpack/package-chunk-sort.d.ts +0 -1
  82. package/{src → dist/src}/utils/webpack/plugins/postcss-cli-resources.d.ts +0 -1
  83. package/{src → dist/src}/utils/webpack/plugins/scripts-webpack-plugin.d.ts +0 -1
  84. package/{src → dist/src}/utils/webpack/read-webpack-options.d.ts +0 -1
  85. package/{src → dist/src}/utils/webpack/resolve-user-defined-webpack-config.d.ts +0 -1
  86. package/{src → dist/src}/utils/with-nx.d.ts +4 -1
  87. package/{src → dist/src}/utils/with-nx.js +6 -0
  88. package/{src → dist/src}/utils/with-web.d.ts +4 -1
  89. package/{src → dist/src}/utils/with-web.js +6 -0
  90. package/{tsconfig-paths-plugin.d.ts → dist/tsconfig-paths-plugin.d.ts} +0 -1
  91. package/executors.json +6 -6
  92. package/generators.json +8 -8
  93. package/migrations.json +36 -5
  94. package/package.json +78 -9
  95. package/app-plugin.d.ts.map +0 -1
  96. package/index.d.ts.map +0 -1
  97. package/plugin.d.ts.map +0 -1
  98. package/src/executors/dev-server/dev-server.impl.d.ts.map +0 -1
  99. package/src/executors/dev-server/lib/get-dev-server-config.d.ts.map +0 -1
  100. package/src/executors/dev-server/lib/serve-path.d.ts.map +0 -1
  101. package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts.map +0 -1
  102. package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts.map +0 -1
  103. package/src/executors/webpack/lib/normalize-options.d.ts.map +0 -1
  104. package/src/executors/webpack/lib/run-webpack.d.ts.map +0 -1
  105. package/src/executors/webpack/webpack.impl.d.ts.map +0 -1
  106. package/src/generators/configuration/configuration.d.ts.map +0 -1
  107. package/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.d.ts.map +0 -1
  108. package/src/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.d.ts.map +0 -1
  109. package/src/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.d.ts.map +0 -1
  110. package/src/generators/convert-config-to-webpack-plugin/lib/utils.d.ts.map +0 -1
  111. package/src/generators/convert-config-to-webpack-plugin/lib/validate-project.d.ts.map +0 -1
  112. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  113. package/src/generators/convert-to-inferred/utils/ast.d.ts.map +0 -1
  114. package/src/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts.map +0 -1
  115. package/src/generators/convert-to-inferred/utils/index.d.ts.map +0 -1
  116. package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts.map +0 -1
  117. package/src/generators/convert-to-inferred/utils/types.d.ts.map +0 -1
  118. package/src/generators/init/init.d.ts.map +0 -1
  119. package/src/migrations/update-21-0-0/remove-isolated-config.d.ts.map +0 -1
  120. package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts.map +0 -1
  121. package/src/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.d.ts.map +0 -1
  122. package/src/plugins/generate-package-json-plugin.d.ts.map +0 -1
  123. package/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.d.ts.map +0 -1
  124. package/src/plugins/nx-webpack-plugin/lib/apply-base-config.d.ts.map +0 -1
  125. package/src/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts.map +0 -1
  126. package/src/plugins/nx-webpack-plugin/lib/compiler-loaders.d.ts.map +0 -1
  127. package/src/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.d.ts.map +0 -1
  128. package/src/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.d.ts.map +0 -1
  129. package/src/plugins/nx-webpack-plugin/lib/normalize-options.d.ts.map +0 -1
  130. package/src/plugins/nx-webpack-plugin/lib/stylesheet-loaders.d.ts.map +0 -1
  131. package/src/plugins/nx-webpack-plugin/lib/utils.d.ts.map +0 -1
  132. package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts.map +0 -1
  133. package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin.d.ts.map +0 -1
  134. package/src/plugins/plugin.d.ts.map +0 -1
  135. package/src/plugins/stats-json-plugin.d.ts.map +0 -1
  136. package/src/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts.map +0 -1
  137. package/src/plugins/webpack-nx-build-coordination-plugin.d.ts.map +0 -1
  138. package/src/plugins/write-index-html-plugin.d.ts.map +0 -1
  139. package/src/utils/config.d.ts.map +0 -1
  140. package/src/utils/create-copy-plugin.d.ts.map +0 -1
  141. package/src/utils/deprecation.d.ts.map +0 -1
  142. package/src/utils/e2e-web-server-info-utils.d.ts.map +0 -1
  143. package/src/utils/ensure-dependencies.d.ts.map +0 -1
  144. package/src/utils/fs.d.ts.map +0 -1
  145. package/src/utils/get-client-environment.d.ts.map +0 -1
  146. package/src/utils/get-css-module-local-ident.d.ts.map +0 -1
  147. package/src/utils/has-plugin.d.ts.map +0 -1
  148. package/src/utils/hash-format.d.ts.map +0 -1
  149. package/src/utils/models.d.ts.map +0 -1
  150. package/src/utils/run-webpack.d.ts.map +0 -1
  151. package/src/utils/versions.d.ts +0 -8
  152. package/src/utils/versions.d.ts.map +0 -1
  153. package/src/utils/versions.js +0 -11
  154. package/src/utils/web-babel-loader.d.ts +0 -1
  155. package/src/utils/web-babel-loader.d.ts.map +0 -1
  156. package/src/utils/webpack/interpolate-env-variables-to-index.d.ts.map +0 -1
  157. package/src/utils/webpack/normalize-entry.d.ts.map +0 -1
  158. package/src/utils/webpack/package-chunk-sort.d.ts.map +0 -1
  159. package/src/utils/webpack/plugins/postcss-cli-resources.d.ts.map +0 -1
  160. package/src/utils/webpack/plugins/scripts-webpack-plugin.d.ts.map +0 -1
  161. package/src/utils/webpack/read-webpack-options.d.ts.map +0 -1
  162. package/src/utils/webpack/resolve-user-defined-webpack-config.d.ts.map +0 -1
  163. package/src/utils/with-nx.d.ts.map +0 -1
  164. package/src/utils/with-web.d.ts.map +0 -1
  165. package/tsconfig-paths-plugin.d.ts.map +0 -1
  166. /package/{LICENSE → dist/LICENSE} +0 -0
  167. /package/{app-plugin.js → dist/app-plugin.js} +0 -0
  168. /package/{index.js → dist/index.js} +0 -0
  169. /package/{plugin.js → dist/plugin.js} +0 -0
  170. /package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.js +0 -0
  171. /package/{src → dist/src}/executors/dev-server/lib/serve-path.js +0 -0
  172. /package/{src → dist/src}/executors/dev-server/schema.d.ts +0 -0
  173. /package/{src → dist/src}/executors/dev-server/schema.json +0 -0
  174. /package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.js +0 -0
  175. /package/{src → dist/src}/executors/ssr-dev-server/schema.d.ts +0 -0
  176. /package/{src → dist/src}/executors/ssr-dev-server/schema.json +0 -0
  177. /package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.js +0 -0
  178. /package/{src → dist/src}/executors/webpack/lib/normalize-options.js +0 -0
  179. /package/{src → dist/src}/executors/webpack/schema.d.ts +0 -0
  180. /package/{src → dist/src}/executors/webpack/schema.json +0 -0
  181. /package/{src → dist/src}/executors/webpack/webpack.impl.js +0 -0
  182. /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
  183. /package/{src → dist/src}/generators/configuration/schema.json +0 -0
  184. /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.js +0 -0
  185. /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/normalize-path-options.js +0 -0
  186. /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/utils.js +0 -0
  187. /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/lib/validate-project.js +0 -0
  188. /package/{src → dist/src}/generators/convert-config-to-webpack-plugin/schema.json +0 -0
  189. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  190. /package/{src → dist/src}/generators/convert-to-inferred/utils/ast.js +0 -0
  191. /package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.js +0 -0
  192. /package/{src → dist/src}/generators/convert-to-inferred/utils/index.js +0 -0
  193. /package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.js +0 -0
  194. /package/{src → dist/src}/generators/convert-to-inferred/utils/types.js +0 -0
  195. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  196. /package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.js +0 -0
  197. /package/{src → dist/src}/migrations/update-21-0-0/remove-isolated-config.md +0 -0
  198. /package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.js +0 -0
  199. /package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.js +0 -0
  200. /package/{src → dist/src}/migrations/update-23-0-0/remove-nx-tsconfig-paths-webpack-plugin-import.md +0 -0
  201. /package/{src → dist/src}/plugins/generate-package-json-plugin.js +0 -0
  202. /package/{src → dist/src}/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js +0 -0
  203. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-base-config.js +0 -0
  204. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/apply-web-config.js +0 -0
  205. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/compiler-loaders.js +0 -0
  206. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/get-terser-ecma-version.js +0 -0
  207. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/instantiate-script-plugins.js +0 -0
  208. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/normalize-options.js +0 -0
  209. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/stylesheet-loaders.js +0 -0
  210. /package/{src → dist/src}/plugins/nx-webpack-plugin/lib/utils.js +0 -0
  211. /package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.js +0 -0
  212. /package/{src → dist/src}/plugins/nx-webpack-plugin/nx-app-webpack-plugin.js +0 -0
  213. /package/{src → dist/src}/plugins/stats-json-plugin.js +0 -0
  214. /package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.js +0 -0
  215. /package/{src → dist/src}/plugins/webpack-nx-build-coordination-plugin.js +0 -0
  216. /package/{src → dist/src}/plugins/write-index-html-plugin.js +0 -0
  217. /package/{src → dist/src}/utils/create-copy-plugin.js +0 -0
  218. /package/{src → dist/src}/utils/e2e-web-server-info-utils.js +0 -0
  219. /package/{src → dist/src}/utils/fs.js +0 -0
  220. /package/{src → dist/src}/utils/get-client-environment.js +0 -0
  221. /package/{src → dist/src}/utils/get-css-module-local-ident.js +0 -0
  222. /package/{src → dist/src}/utils/has-plugin.js +0 -0
  223. /package/{src → dist/src}/utils/hash-format.js +0 -0
  224. /package/{src → dist/src}/utils/models.js +0 -0
  225. /package/{src → dist/src}/utils/run-webpack.js +0 -0
  226. /package/{src → dist/src}/utils/webpack/deprecated-less-loader.js +0 -0
  227. /package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.js +0 -0
  228. /package/{src → dist/src}/utils/webpack/normalize-entry.js +0 -0
  229. /package/{src → dist/src}/utils/webpack/package-chunk-sort.js +0 -0
  230. /package/{src → dist/src}/utils/webpack/plugins/postcss-cli-resources.js +0 -0
  231. /package/{src → dist/src}/utils/webpack/plugins/scripts-webpack-plugin.js +0 -0
  232. /package/{src → dist/src}/utils/webpack/read-webpack-options.js +0 -0
  233. /package/{src → dist/src}/utils/webpack/resolve-user-defined-webpack-config.js +0 -0
  234. /package/{tsconfig-paths-plugin.js → dist/tsconfig-paths-plugin.js} +0 -0
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = rewriteInternalSubpathImports;
4
+ exports.rewriteSubpathImports = rewriteSubpathImports;
5
+ const devkit_1 = require("@nx/devkit");
6
+ const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
7
+ const FROM_PREFIX = '@nx/webpack/src/';
8
+ const TO_PUBLIC = '@nx/webpack';
9
+ const TO_INTERNAL = '@nx/webpack/internal';
10
+ // Symbols exported from `@nx/webpack`'s public entry (packages/webpack/index.ts).
11
+ // A named import/export of one of these from `@nx/webpack/src/*` is routed to
12
+ // the public `@nx/webpack` entry; everything else goes to `@nx/webpack/internal`.
13
+ const PUBLIC_SYMBOLS = new Set([
14
+ 'AssetGlobPattern',
15
+ 'AsyncNxComposableWebpackPlugin',
16
+ 'FileReplacement',
17
+ 'MergedOptions',
18
+ 'NormalizedWebpackExecutorOptions',
19
+ 'NxComposableWebpackPlugin',
20
+ 'NxWebpackExecutionContext',
21
+ 'NxWebpackPlugin',
22
+ 'WebDevServerOptions',
23
+ 'WebpackExecutorEvent',
24
+ 'WebpackExecutorOptions',
25
+ 'WithNxOptions',
26
+ 'WithWebOptions',
27
+ 'composePlugins',
28
+ 'composePluginsSync',
29
+ 'configurationGenerator',
30
+ 'convertConfigToWebpackPluginGenerator',
31
+ 'createCopyPlugin',
32
+ 'devServerExecutor',
33
+ 'getCSSModuleLocalIdent',
34
+ 'getWebpackE2EWebServerInfo',
35
+ 'isNxWebpackComposablePlugin',
36
+ 'normalizeOptions',
37
+ 'normalizePluginPath',
38
+ 'nxWebpackComposablePlugin',
39
+ 'useLegacyNxPlugin',
40
+ 'webpackExecutor',
41
+ 'webpackInitGenerator',
42
+ 'webpackProjectGenerator',
43
+ 'withNx',
44
+ 'withWeb',
45
+ ]);
46
+ // Methods on `jest` and `vi` that take a module specifier as their first arg.
47
+ const MOCK_HELPER_METHODS = new Set([
48
+ 'mock',
49
+ 'unmock',
50
+ 'doMock',
51
+ 'dontMock',
52
+ 'requireActual',
53
+ 'requireMock',
54
+ 'importActual',
55
+ 'importMock',
56
+ ]);
57
+ let ts;
58
+ async function rewriteInternalSubpathImports(tree) {
59
+ let touchedCount = 0;
60
+ (0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
61
+ if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
62
+ return;
63
+ }
64
+ const original = tree.read(filePath, 'utf-8');
65
+ if (!original || !original.includes(FROM_PREFIX)) {
66
+ return;
67
+ }
68
+ const updated = rewriteSubpathImports(original);
69
+ if (updated !== original) {
70
+ tree.write(filePath, updated);
71
+ touchedCount += 1;
72
+ }
73
+ });
74
+ if (touchedCount > 0) {
75
+ devkit_1.logger.info(`Rewrote @nx/webpack/src/* imports in ${touchedCount} file(s) ` +
76
+ `(public symbols to @nx/webpack, internals to @nx/webpack/internal).`);
77
+ }
78
+ await (0, devkit_1.formatFiles)(tree);
79
+ }
80
+ function rewriteSubpathImports(source) {
81
+ ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
82
+ const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
83
+ /* setParentNodes */ true, ts.ScriptKind.TSX);
84
+ const changes = [];
85
+ for (const stmt of sourceFile.statements) {
86
+ if (ts.isImportDeclaration(stmt)) {
87
+ collectImportRewrite(sourceFile, stmt, changes);
88
+ }
89
+ else if (ts.isExportDeclaration(stmt)) {
90
+ collectExportRewrite(sourceFile, stmt, changes);
91
+ }
92
+ }
93
+ collectCallExpressionRewrites(sourceFile, changes);
94
+ return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
95
+ }
96
+ function isSubpathSpecifier(node) {
97
+ return ts.isStringLiteral(node) && node.text.startsWith(FROM_PREFIX);
98
+ }
99
+ function collectImportRewrite(sourceFile, stmt, changes) {
100
+ if (!isSubpathSpecifier(stmt.moduleSpecifier)) {
101
+ return;
102
+ }
103
+ const clause = stmt.importClause;
104
+ // Pure named imports (`import { a, b } from '...'`) can be split by symbol.
105
+ // A default or namespace import grabs the whole module, so it can't be
106
+ // split — route it wholesale to the internal entry.
107
+ if (clause &&
108
+ !clause.name &&
109
+ clause.namedBindings &&
110
+ ts.isNamedImports(clause.namedBindings)) {
111
+ rewriteNamedDeclaration(sourceFile, stmt, stmt.moduleSpecifier, clause.isTypeOnly, clause.namedBindings.elements, 'import', changes);
112
+ return;
113
+ }
114
+ replaceSpecifier(sourceFile, stmt.moduleSpecifier, TO_INTERNAL, changes);
115
+ }
116
+ function collectExportRewrite(sourceFile, stmt, changes) {
117
+ if (!stmt.moduleSpecifier || !isSubpathSpecifier(stmt.moduleSpecifier)) {
118
+ return;
119
+ }
120
+ // `export { a, b } from '...'` can be split; `export * from '...'` cannot.
121
+ if (stmt.exportClause && ts.isNamedExports(stmt.exportClause)) {
122
+ rewriteNamedDeclaration(sourceFile, stmt, stmt.moduleSpecifier, stmt.isTypeOnly, stmt.exportClause.elements, 'export', changes);
123
+ return;
124
+ }
125
+ replaceSpecifier(sourceFile, stmt.moduleSpecifier, TO_INTERNAL, changes);
126
+ }
127
+ /**
128
+ * Partition the named bindings of an import/export declaration into the ones
129
+ * that resolve to `@nx/webpack`'s public entry and the ones that don't. If both
130
+ * groups are non-empty, the single declaration is split into two.
131
+ */
132
+ function rewriteNamedDeclaration(sourceFile, decl, specifier, isTypeOnly, elements, keyword, changes) {
133
+ const publicEls = [];
134
+ const internalEls = [];
135
+ for (const el of elements) {
136
+ // `propertyName` is the original name in `orig as alias`; fall back to
137
+ // `name` for the plain `orig` form.
138
+ const importedName = (el.propertyName ?? el.name).text;
139
+ (PUBLIC_SYMBOLS.has(importedName) ? publicEls : internalEls).push(el);
140
+ }
141
+ if (publicEls.length === 0) {
142
+ replaceSpecifier(sourceFile, specifier, TO_INTERNAL, changes);
143
+ return;
144
+ }
145
+ if (internalEls.length === 0) {
146
+ replaceSpecifier(sourceFile, specifier, TO_PUBLIC, changes);
147
+ return;
148
+ }
149
+ // Mixed — replace the whole declaration with one statement per target.
150
+ const quote = sourceFile.text.charAt(specifier.getStart(sourceFile));
151
+ const start = decl.getStart(sourceFile);
152
+ const end = decl.getEnd();
153
+ const semicolon = sourceFile.text.charAt(end - 1) === ';' ? ';' : '';
154
+ const prefix = isTypeOnly ? `${keyword} type` : keyword;
155
+ const render = (els, target) => `${prefix} { ${els
156
+ .map((el) => el.getText(sourceFile))
157
+ .join(', ')} } from ${quote}${target}${quote}${semicolon}`;
158
+ changes.push({ type: devkit_1.ChangeType.Delete, start, length: end - start }, {
159
+ type: devkit_1.ChangeType.Insert,
160
+ index: start,
161
+ text: `${render(publicEls, TO_PUBLIC)}\n${render(internalEls, TO_INTERNAL)}`,
162
+ });
163
+ }
164
+ function collectCallExpressionRewrites(sourceFile, changes) {
165
+ const visit = (node) => {
166
+ if (ts.isCallExpression(node) &&
167
+ shouldRewriteCallExpression(node) &&
168
+ node.arguments.length >= 1 &&
169
+ isSubpathSpecifier(node.arguments[0])) {
170
+ // `require(...)`, dynamic `import(...)` and `jest.mock(...)` reference
171
+ // the module as a whole and can't be symbol-split, so they go to the
172
+ // internal entry.
173
+ replaceSpecifier(sourceFile, node.arguments[0], TO_INTERNAL, changes);
174
+ }
175
+ else if (ts.isImportTypeNode(node)) {
176
+ // `typeof import('...')` parses as an `ImportTypeNode`, not a
177
+ // CallExpression — its argument is `LiteralTypeNode<StringLiteral>`.
178
+ // The whole module is referenced, so it can't be symbol-split.
179
+ const literal = getImportTypeStringLiteral(node);
180
+ if (literal && literal.text.startsWith(FROM_PREFIX)) {
181
+ replaceSpecifier(sourceFile, literal, TO_INTERNAL, changes);
182
+ }
183
+ }
184
+ ts.forEachChild(node, visit);
185
+ };
186
+ visit(sourceFile);
187
+ }
188
+ function getImportTypeStringLiteral(node) {
189
+ const arg = node.argument;
190
+ if (arg && ts.isLiteralTypeNode(arg) && ts.isStringLiteral(arg.literal)) {
191
+ return arg.literal;
192
+ }
193
+ return undefined;
194
+ }
195
+ function shouldRewriteCallExpression(call) {
196
+ const callee = call.expression;
197
+ // `require('...')`
198
+ if (ts.isIdentifier(callee) && callee.text === 'require')
199
+ return true;
200
+ // dynamic `import('...')` (runtime form parses as a CallExpression whose
201
+ // callee is the `import` keyword). The `typeof import('...')` type-position
202
+ // form is an `ImportTypeNode` (handled in `collectCallExpressionRewrites`).
203
+ if (callee.kind === ts.SyntaxKind.ImportKeyword)
204
+ return true;
205
+ // `jest.mock(...)` / `vi.mock(...)` and friends.
206
+ if (ts.isPropertyAccessExpression(callee)) {
207
+ const obj = callee.expression;
208
+ if (ts.isIdentifier(obj) &&
209
+ (obj.text === 'jest' || obj.text === 'vi') &&
210
+ MOCK_HELPER_METHODS.has(callee.name.text)) {
211
+ return true;
212
+ }
213
+ }
214
+ return false;
215
+ }
216
+ function replaceSpecifier(sourceFile, literal, target, changes) {
217
+ const start = literal.getStart(sourceFile);
218
+ const end = literal.getEnd();
219
+ const quote = sourceFile.text.charAt(start);
220
+ changes.push({ type: devkit_1.ChangeType.Delete, start, length: end - start }, {
221
+ type: devkit_1.ChangeType.Insert,
222
+ index: start,
223
+ text: `${quote}${target}${quote}`,
224
+ });
225
+ }
@@ -15,4 +15,3 @@ export declare class GeneratePackageJsonPlugin implements WebpackPluginInstance
15
15
  private resolveRuntimeDependencies;
16
16
  apply(compiler: Compiler): void;
17
17
  }
18
- //# sourceMappingURL=generate-package-json-plugin.d.ts.map
@@ -6,4 +6,3 @@ export declare class NxTsconfigPathsWebpackPlugin {
6
6
  apply(compiler: Compiler): void;
7
7
  handleBuildLibsFromSource(config: Partial<WebpackOptionsNormalized | Configuration>, options: NormalizedNxAppWebpackPluginOptions): void;
8
8
  }
9
- //# sourceMappingURL=nx-tsconfig-paths-webpack-plugin.d.ts.map
@@ -3,4 +3,3 @@ import { NormalizedNxAppWebpackPluginOptions } from '../nx-app-webpack-plugin-op
3
3
  export declare function applyBaseConfig(options: NormalizedNxAppWebpackPluginOptions, config?: Partial<WebpackOptionsNormalized | Configuration>, { useNormalizedEntry, }?: {
4
4
  useNormalizedEntry?: boolean;
5
5
  }): void;
6
- //# sourceMappingURL=apply-base-config.d.ts.map
@@ -3,4 +3,3 @@ import { NormalizedNxAppWebpackPluginOptions } from '../nx-app-webpack-plugin-op
3
3
  export declare function applyWebConfig(options: NormalizedNxAppWebpackPluginOptions, config?: Partial<WebpackOptionsNormalized | Configuration>, { useNormalizedEntry, }?: {
4
4
  useNormalizedEntry?: boolean;
5
5
  }): void;
6
- //# sourceMappingURL=apply-web-config.d.ts.map
@@ -53,4 +53,3 @@ export declare function createLoaderFromCompiler(options: NormalizedNxAppWebpack
53
53
  jsc?: undefined;
54
54
  };
55
55
  };
56
- //# sourceMappingURL=compiler-loaders.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function getTerserEcmaVersion(projectRoot: string): 2020 | 5;
2
- //# sourceMappingURL=get-terser-ecma-version.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { WebpackPluginInstance } from 'webpack';
2
2
  import { NormalizedNxAppWebpackPluginOptions } from '../nx-app-webpack-plugin-options';
3
3
  export declare function instantiateScriptPlugins(options: NormalizedNxAppWebpackPluginOptions): WebpackPluginInstance[];
4
- //# sourceMappingURL=instantiate-script-plugins.d.ts.map
@@ -2,4 +2,3 @@ import { AssetGlobPattern, FileReplacement, NormalizedNxAppWebpackPluginOptions,
2
2
  export declare function normalizeOptions(options: NxAppWebpackPluginOptions): NormalizedNxAppWebpackPluginOptions;
3
3
  export declare function normalizeAssets(assets: any[], root: string, sourceRoot: string, projectRoot: string, resolveRelativePathsToProjectRoot?: boolean): AssetGlobPattern[];
4
4
  export declare function normalizeFileReplacements(root: string, fileReplacements: FileReplacement[]): FileReplacement[];
5
- //# sourceMappingURL=normalize-options.d.ts.map
@@ -71,4 +71,3 @@ export declare function getCommonLoadersForGlobalStyle(options: NormalizedNxAppW
71
71
  };
72
72
  })[];
73
73
  export {};
74
- //# sourceMappingURL=stylesheet-loaders.d.ts.map
@@ -24,4 +24,3 @@ export declare function getAllTransitiveDeps(graph: ProjectGraph, targetName: st
24
24
  * @returns A list of all non-buildable libraries that the project depends on, including transitive dependencies.
25
25
  */
26
26
  export declare function getNonBuildableLibs(graph: ProjectGraph, projectName: string): (string | RegExp)[];
27
- //# sourceMappingURL=utils.d.ts.map
@@ -271,4 +271,3 @@ export interface NormalizedNxAppWebpackPluginOptions extends NxAppWebpackPluginO
271
271
  outputFileName: string;
272
272
  assets: AssetGlobPattern[];
273
273
  }
274
- //# sourceMappingURL=nx-app-webpack-plugin-options.d.ts.map
@@ -15,4 +15,3 @@ export declare class NxAppWebpackPlugin {
15
15
  constructor(options?: NxAppWebpackPluginOptions);
16
16
  apply(compiler: Compiler): void;
17
17
  }
18
- //# sourceMappingURL=nx-app-webpack-plugin.d.ts.map
@@ -1,4 +1,4 @@
1
- import { CreateDependencies, CreateNodesV2 } from '@nx/devkit';
1
+ import { CreateDependencies, CreateNodes } from '@nx/devkit';
2
2
  export interface WebpackPluginOptions {
3
3
  buildTargetName?: string;
4
4
  serveTargetName?: string;
@@ -11,6 +11,5 @@ export interface WebpackPluginOptions {
11
11
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
12
12
  */
13
13
  export declare const createDependencies: CreateDependencies;
14
- export declare const createNodes: CreateNodesV2<WebpackPluginOptions>;
15
- export declare const createNodesV2: CreateNodesV2<WebpackPluginOptions>;
16
- //# sourceMappingURL=plugin.d.ts.map
14
+ export declare const createNodes: CreateNodes<WebpackPluginOptions>;
15
+ export declare const createNodesV2: CreateNodes<WebpackPluginOptions>;
@@ -88,7 +88,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
88
88
  const targets = {};
89
89
  targets[options.buildTargetName] = {
90
90
  command: `webpack-cli build`,
91
- options: { cwd: projectRoot, args: ['--node-env=production'] },
91
+ options: { cwd: projectRoot, env: { NODE_ENV: 'production' } },
92
92
  cache: true,
93
93
  dependsOn: [`^${options.buildTargetName}`],
94
94
  inputs: 'production' in namedInputs
@@ -128,7 +128,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
128
128
  command: `webpack-cli serve`,
129
129
  options: {
130
130
  cwd: projectRoot,
131
- args: ['--node-env=development'],
131
+ env: { NODE_ENV: 'development' },
132
132
  },
133
133
  metadata: {
134
134
  technologies: ['webpack'],
@@ -148,7 +148,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
148
148
  command: `webpack-cli serve`,
149
149
  options: {
150
150
  cwd: projectRoot,
151
- args: ['--node-env=production'],
151
+ env: { NODE_ENV: 'production' },
152
152
  },
153
153
  metadata: {
154
154
  technologies: ['webpack'],
@@ -2,4 +2,3 @@ import { Compiler } from 'webpack';
2
2
  export declare class StatsJsonPlugin {
3
3
  apply(compiler: Compiler): void;
4
4
  }
5
- //# sourceMappingURL=stats-json-plugin.d.ts.map
@@ -29,4 +29,3 @@ module.exports = async () => ({
29
29
  export declare function useLegacyNxPlugin(fn: (config: Configuration, ctx: NxWebpackExecutionContext) => Promise<Configuration>, executorOptions: NxAppWebpackPluginOptions): Promise<{
30
30
  apply(compiler: Compiler): void;
31
31
  }>;
32
- //# sourceMappingURL=use-legacy-nx-plugin.d.ts.map
@@ -19,4 +19,3 @@ export declare class WebpackNxBuildCoordinationPlugin {
19
19
  private createFileWatcher;
20
20
  }
21
21
  export {};
22
- //# sourceMappingURL=webpack-nx-build-coordination-plugin.d.ts.map
@@ -20,4 +20,3 @@ export declare class WriteIndexHtmlPlugin {
20
20
  private generateSriAttributes;
21
21
  private filterAndMapBuildFiles;
22
22
  }
23
- //# sourceMappingURL=write-index-html-plugin.d.ts.map
@@ -14,10 +14,21 @@ export interface NxComposableWebpackPlugin {
14
14
  export interface AsyncNxComposableWebpackPlugin {
15
15
  (config: Configuration, ctx: NxWebpackExecutionContext): Configuration | Promise<Configuration>;
16
16
  }
17
+ /**
18
+ * @deprecated Will be removed in Nx v24. Use `NxAppWebpackPlugin` from
19
+ * `@nx/webpack/app-plugin` in a standard webpack config and run
20
+ * `nx g @nx/webpack:convert-to-inferred`. See
21
+ * https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
22
+ */
17
23
  export declare function composePlugins(...plugins: (NxComposableWebpackPlugin | AsyncNxComposableWebpackPlugin | Promise<NxComposableWebpackPlugin | AsyncNxComposableWebpackPlugin>)[]): ((config: Configuration, ctx: NxWebpackExecutionContext) => Promise<Configuration>) & {
18
24
  nxWebpackComposablePlugin: boolean;
19
25
  };
26
+ /**
27
+ * @deprecated Will be removed in Nx v24. Use `NxAppWebpackPlugin` from
28
+ * `@nx/webpack/app-plugin` in a standard webpack config and run
29
+ * `nx g @nx/webpack:convert-to-inferred`. See
30
+ * https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
31
+ */
20
32
  export declare function composePluginsSync(...plugins: NxComposableWebpackPlugin[]): ((config: Configuration, ctx: NxWebpackExecutionContext) => Configuration) & {
21
33
  nxWebpackComposablePlugin: boolean;
22
34
  };
23
- //# sourceMappingURL=config.d.ts.map
@@ -7,11 +7,19 @@ exports.composePluginsSync = composePluginsSync;
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const internal_1 = require("@nx/js/internal");
9
9
  const configuration_1 = require("nx/src/config/configuration");
10
+ const deprecation_1 = require("./deprecation");
10
11
  exports.nxWebpackComposablePlugin = 'nxWebpackComposablePlugin';
11
12
  function isNxWebpackComposablePlugin(a) {
12
13
  return a?.[exports.nxWebpackComposablePlugin] === true;
13
14
  }
15
+ /**
16
+ * @deprecated Will be removed in Nx v24. Use `NxAppWebpackPlugin` from
17
+ * `@nx/webpack/app-plugin` in a standard webpack config and run
18
+ * `nx g @nx/webpack:convert-to-inferred`. See
19
+ * https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
20
+ */
14
21
  function composePlugins(...plugins) {
22
+ (0, deprecation_1.warnWebpackComposeHelpersDeprecation)();
15
23
  return Object.assign(async function combined(config, ctx) {
16
24
  // Webpack may be calling us as a standard config function.
17
25
  // Build up Nx context from environment variables.
@@ -31,7 +39,14 @@ function composePlugins(...plugins) {
31
39
  [exports.nxWebpackComposablePlugin]: true,
32
40
  });
33
41
  }
42
+ /**
43
+ * @deprecated Will be removed in Nx v24. Use `NxAppWebpackPlugin` from
44
+ * `@nx/webpack/app-plugin` in a standard webpack config and run
45
+ * `nx g @nx/webpack:convert-to-inferred`. See
46
+ * https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
47
+ */
34
48
  function composePluginsSync(...plugins) {
49
+ (0, deprecation_1.warnWebpackComposeHelpersDeprecation)();
35
50
  return Object.assign(function combined(config, ctx) {
36
51
  for (const plugin of plugins) {
37
52
  config = plugin(config, ctx);
@@ -1,4 +1,3 @@
1
1
  import CopyWebpackPlugin from 'copy-webpack-plugin';
2
2
  import { AssetGlobPattern } from '../executors/webpack/schema';
3
3
  export declare function createCopyPlugin(assets: AssetGlobPattern[]): CopyWebpackPlugin;
4
- //# sourceMappingURL=create-copy-plugin.d.ts.map
@@ -3,4 +3,6 @@ export declare const WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx
3
3
  export declare function warnWebpackExecutorDeprecation(): void;
4
4
  export declare function warnWebpackDevServerExecutorDeprecation(): void;
5
5
  export declare function warnWebpackExecutorGenerating(): void;
6
- //# sourceMappingURL=deprecation.d.ts.map
6
+ export declare const WEBPACK_COMPOSE_HELPERS_DEPRECATION_MESSAGE = "The `composePlugins`, `withNx`, and `withWeb` config helpers from `@nx/webpack` are deprecated and will be removed in Nx v24. They produce an Nx-specific config function that only runs under the `@nx/webpack:webpack` executor. Migrate to a standard webpack config that uses `NxAppWebpackPlugin` (from `@nx/webpack/app-plugin`) under the inferred `@nx/webpack/plugin` by running `nx g @nx/webpack:convert-to-inferred`. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
7
+ export declare function suppressWebpackComposeHelperWarnings<T>(fn: () => T): T;
8
+ export declare function warnWebpackComposeHelpersDeprecation(): void;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.WEBPACK_EXECUTOR_DEPRECATION_MESSAGE = void 0;
3
+ exports.WEBPACK_COMPOSE_HELPERS_DEPRECATION_MESSAGE = exports.WEBPACK_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.WEBPACK_EXECUTOR_DEPRECATION_MESSAGE = void 0;
4
4
  exports.warnWebpackExecutorDeprecation = warnWebpackExecutorDeprecation;
5
5
  exports.warnWebpackDevServerExecutorDeprecation = warnWebpackDevServerExecutorDeprecation;
6
6
  exports.warnWebpackExecutorGenerating = warnWebpackExecutorGenerating;
7
+ exports.suppressWebpackComposeHelperWarnings = suppressWebpackComposeHelperWarnings;
8
+ exports.warnWebpackComposeHelpersDeprecation = warnWebpackComposeHelpersDeprecation;
7
9
  const devkit_1 = require("@nx/devkit");
8
10
  // TODO(v24): Remove the @nx/webpack:webpack and @nx/webpack:dev-server
9
11
  // executors. The inferred plugin (@nx/webpack/plugin) and the
@@ -23,3 +25,31 @@ function warnWebpackDevServerExecutorDeprecation() {
23
25
  function warnWebpackExecutorGenerating() {
24
26
  devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
25
27
  }
28
+ // TODO(v24): Remove the composePlugins/withNx/withWeb config helpers. They emit
29
+ // an Nx-specific config function that only runs under the @nx/webpack:webpack
30
+ // executor; the inferred @nx/webpack/plugin works with standard webpack configs
31
+ // built around NxAppWebpackPlugin instead.
32
+ exports.WEBPACK_COMPOSE_HELPERS_DEPRECATION_MESSAGE = 'The `composePlugins`, `withNx`, and `withWeb` config helpers from `@nx/webpack` are deprecated and will be removed in Nx v24. They produce an Nx-specific config function that only runs under the `@nx/webpack:webpack` executor. Migrate to a standard webpack config that uses `NxAppWebpackPlugin` (from `@nx/webpack/app-plugin`) under the inferred `@nx/webpack/plugin` by running `nx g @nx/webpack:convert-to-inferred`. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
33
+ let composeHelpersWarned = false;
34
+ let suppressDepth = 0;
35
+ // Nx-internal entry points compose these helpers themselves (e.g. the rspack
36
+ // executor, the storybook/component-testing presets). They wrap their
37
+ // synchronous composition in this so the warning fires only for user-authored
38
+ // configs, not for users who never touched the compose helpers.
39
+ function suppressWebpackComposeHelperWarnings(fn) {
40
+ suppressDepth++;
41
+ try {
42
+ return fn();
43
+ }
44
+ finally {
45
+ suppressDepth--;
46
+ }
47
+ }
48
+ // Warn once per process so a `composePlugins(withNx(), withWeb())` chain logs a
49
+ // single line, not one per helper, and HMR reloads don't repeat it.
50
+ function warnWebpackComposeHelpersDeprecation() {
51
+ if (suppressDepth > 0 || composeHelpersWarned)
52
+ return;
53
+ composeHelpersWarned = true;
54
+ devkit_1.logger.warn(exports.WEBPACK_COMPOSE_HELPERS_DEPRECATION_MESSAGE);
55
+ }
@@ -1,3 +1,2 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  export declare function getWebpackE2EWebServerInfo(tree: Tree, projectName: string, configFilePath: string, isPluginBeingAdded: boolean, e2ePortOverride?: number): Promise<import("@nx/devkit/internal").E2EWebServerDetails>;
3
- //# sourceMappingURL=e2e-web-server-info-utils.d.ts.map
@@ -4,4 +4,3 @@ export type EnsureDependenciesOptions = {
4
4
  uiFramework?: 'none' | 'react';
5
5
  };
6
6
  export declare function ensureDependencies(tree: Tree, options: EnsureDependenciesOptions): GeneratorCallback;
7
- //# sourceMappingURL=ensure-dependencies.d.ts.map
@@ -21,6 +21,6 @@ function ensureDependencies(tree, options) {
21
21
  devDependencies['@svgr/webpack'] = versions_1.svgrWebpackVersion;
22
22
  devDependencies['react-refresh'] = versions_1.reactRefreshVersion;
23
23
  }
24
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies));
24
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, true));
25
25
  return (0, devkit_1.runTasksInSerial)(...tasks);
26
26
  }
@@ -4,4 +4,3 @@ export declare function findAllNodeModules(from: string, root?: string): string[
4
4
  * Delete an output directory, but error out if it's the root of the project.
5
5
  */
6
6
  export declare function deleteOutputDir(root: string, outputPath: string): void;
7
- //# sourceMappingURL=fs.d.ts.map
@@ -3,4 +3,3 @@ export declare function getClientEnvironment(mode?: string): {
3
3
  'process.env': {};
4
4
  };
5
5
  };
6
- //# sourceMappingURL=get-client-environment.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function getCSSModuleLocalIdent(ctx: any, localIdentName: any, localName: any, options: any): any;
2
- //# sourceMappingURL=get-css-module-local-ident.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export declare function hasPlugin(tree: Tree): boolean;
3
- //# sourceMappingURL=has-plugin.d.ts.map
@@ -5,4 +5,3 @@ export interface HashFormat {
5
5
  script: string;
6
6
  }
7
7
  export declare function getOutputHashFormat(option: string, length?: number): HashFormat;
8
- //# sourceMappingURL=hash-format.d.ts.map
@@ -21,4 +21,3 @@ export interface CreateWebpackConfigOptions<T = any> {
21
21
  tsConfig: any;
22
22
  tsConfigPath: string;
23
23
  }
24
- //# sourceMappingURL=models.d.ts.map
@@ -3,4 +3,3 @@ export declare function runWebpackDevServer(config: any, webpack: typeof import(
3
3
  stats: any;
4
4
  baseUrl: string;
5
5
  }>;
6
- //# sourceMappingURL=run-webpack.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export declare const nxVersion: any;
3
+ export declare const swcLoaderVersion = "0.1.15";
4
+ export declare const tsLibVersion = "^2.3.0";
5
+ export declare const minSupportedWebpackVersion = "5.0.0";
6
+ export declare const webpackVersion = "^5.101.3";
7
+ export declare const webpackDevServerVersion = "^5.2.1";
8
+ export declare const webpackCliVersion = "^7.0.0";
9
+ export declare const reactRefreshWebpackPluginVersion = "^0.5.7";
10
+ export declare const svgrWebpackVersion = "^8.0.1";
11
+ export declare const reactRefreshVersion = "^0.10.0";
12
+ export declare function assertSupportedWebpackVersion(tree: Tree): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reactRefreshVersion = exports.svgrWebpackVersion = exports.reactRefreshWebpackPluginVersion = exports.webpackCliVersion = exports.webpackDevServerVersion = exports.webpackVersion = exports.minSupportedWebpackVersion = exports.tsLibVersion = exports.swcLoaderVersion = exports.nxVersion = void 0;
4
+ exports.assertSupportedWebpackVersion = assertSupportedWebpackVersion;
5
+ const path_1 = require("path");
6
+ const internal_1 = require("@nx/devkit/internal");
7
+ exports.nxVersion = require((0, path_1.join)('@nx/webpack', 'package.json')).version;
8
+ exports.swcLoaderVersion = '0.1.15';
9
+ exports.tsLibVersion = '^2.3.0';
10
+ // Floor for the generator-level support check. The plugin's runtime code uses
11
+ // webpack 5-only APIs (e.g. `ids.HashedModuleIdsPlugin`, `webpack.sources`,
12
+ // `experiments.cacheUnaffected`), so webpack 5 is the supported floor.
13
+ exports.minSupportedWebpackVersion = '5.0.0';
14
+ // Fresh-install versions written when the package is not already present.
15
+ exports.webpackVersion = '^5.101.3';
16
+ exports.webpackDevServerVersion = '^5.2.1';
17
+ exports.webpackCliVersion = '^7.0.0';
18
+ // React apps
19
+ exports.reactRefreshWebpackPluginVersion = '^0.5.7';
20
+ exports.svgrWebpackVersion = '^8.0.1';
21
+ exports.reactRefreshVersion = '^0.10.0';
22
+ function assertSupportedWebpackVersion(tree) {
23
+ (0, internal_1.assertSupportedPackageVersion)(tree, 'webpack', exports.minSupportedWebpackVersion);
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  module.exports = require('babel-loader').custom(() => {
2
4
  return {
3
5
  customOptions({ isTest, isModern, emitDecoratorMetadata, ...loader }) {
@@ -1,2 +1 @@
1
1
  export declare function interpolateEnvironmentVariablesToIndex(contents: string, deployUrl?: string): string;
2
- //# sourceMappingURL=interpolate-env-variables-to-index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ExtraEntryPoint, NormalizedEntryPoint } from '../models';
2
2
  export declare function normalizeExtraEntryPoints(extraEntryPoints: ExtraEntryPoint[], defaultBundleName: string): NormalizedEntryPoint[];
3
- //# sourceMappingURL=normalize-entry.d.ts.map
@@ -3,4 +3,3 @@ export declare function generateEntryPoints(appConfig: {
3
3
  styles: ExtraEntryPoint[];
4
4
  scripts: ExtraEntryPoint[];
5
5
  }): string[];
6
- //# sourceMappingURL=package-chunk-sort.d.ts.map
@@ -12,4 +12,3 @@ export declare function PostcssCliResources(options: PostcssCliResourcesOptions)
12
12
  postcssPlugin: string;
13
13
  Once(root: any): Promise<void[]>;
14
14
  };
15
- //# sourceMappingURL=postcss-cli-resources.d.ts.map
@@ -15,4 +15,3 @@ export declare class ScriptsWebpackPlugin {
15
15
  private _insertOutput;
16
16
  apply(compiler: webpack.Compiler): void;
17
17
  }
18
- //# sourceMappingURL=scripts-webpack-plugin.d.ts.map
@@ -9,4 +9,3 @@ import { Configuration } from 'webpack';
9
9
  * @param webpackConfig
10
10
  */
11
11
  export declare function readWebpackOptions(webpackConfig: unknown): Promise<Configuration[]>;
12
- //# sourceMappingURL=read-webpack-options.d.ts.map