@nx/angular-rspack 0.0.0-pr-32422-a3285be

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 (193) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +98 -0
  3. package/README.md__tpl__ +48 -0
  4. package/dist/lib/config/config-utils/browser-config.d.ts +4 -0
  5. package/dist/lib/config/config-utils/browser-config.d.ts.map +1 -0
  6. package/dist/lib/config/config-utils/browser-config.js +83 -0
  7. package/dist/lib/config/config-utils/common-config.d.ts +3 -0
  8. package/dist/lib/config/config-utils/common-config.d.ts.map +1 -0
  9. package/dist/lib/config/config-utils/common-config.js +144 -0
  10. package/dist/lib/config/config-utils/dev-server-config-utils.d.ts +4 -0
  11. package/dist/lib/config/config-utils/dev-server-config-utils.d.ts.map +1 -0
  12. package/dist/lib/config/config-utils/dev-server-config-utils.js +258 -0
  13. package/dist/lib/config/config-utils/entry-points.d.ts +9 -0
  14. package/dist/lib/config/config-utils/entry-points.d.ts.map +1 -0
  15. package/dist/lib/config/config-utils/entry-points.js +36 -0
  16. package/dist/lib/config/config-utils/get-stats-options.d.ts +3 -0
  17. package/dist/lib/config/config-utils/get-stats-options.d.ts.map +1 -0
  18. package/dist/lib/config/config-utils/get-stats-options.js +39 -0
  19. package/dist/lib/config/config-utils/helpers.d.ts +13 -0
  20. package/dist/lib/config/config-utils/helpers.d.ts.map +1 -0
  21. package/dist/lib/config/config-utils/helpers.js +106 -0
  22. package/dist/lib/config/config-utils/optimization-config.d.ts +5 -0
  23. package/dist/lib/config/config-utils/optimization-config.d.ts.map +1 -0
  24. package/dist/lib/config/config-utils/optimization-config.js +69 -0
  25. package/dist/lib/config/config-utils/server-config.d.ts +4 -0
  26. package/dist/lib/config/config-utils/server-config.d.ts.map +1 -0
  27. package/dist/lib/config/config-utils/server-config.js +92 -0
  28. package/dist/lib/config/config-utils/sourcemap-utils.d.ts +7 -0
  29. package/dist/lib/config/config-utils/sourcemap-utils.d.ts.map +1 -0
  30. package/dist/lib/config/config-utils/sourcemap-utils.js +48 -0
  31. package/dist/lib/config/config-utils/style-config-utils.d.ts +7 -0
  32. package/dist/lib/config/config-utils/style-config-utils.d.ts.map +1 -0
  33. package/dist/lib/config/config-utils/style-config-utils.js +353 -0
  34. package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts +73 -0
  35. package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts.map +1 -0
  36. package/dist/lib/config/config-utils/user-defined-config-helpers.js +23 -0
  37. package/dist/lib/config/create-config.d.ts +11 -0
  38. package/dist/lib/config/create-config.d.ts.map +1 -0
  39. package/dist/lib/config/create-config.js +35 -0
  40. package/dist/lib/config/i18n/create-i18n-options.d.ts +6 -0
  41. package/dist/lib/config/i18n/create-i18n-options.d.ts.map +1 -0
  42. package/dist/lib/config/i18n/create-i18n-options.js +124 -0
  43. package/dist/lib/index.d.ts +7 -0
  44. package/dist/lib/index.d.ts.map +1 -0
  45. package/dist/lib/index.js +14 -0
  46. package/dist/lib/models/angular-rspack-plugin-options.d.ts +344 -0
  47. package/dist/lib/models/angular-rspack-plugin-options.d.ts.map +1 -0
  48. package/dist/lib/models/angular-rspack-plugin-options.js +2 -0
  49. package/dist/lib/models/augmented-compilation.d.ts +13 -0
  50. package/dist/lib/models/augmented-compilation.d.ts.map +1 -0
  51. package/dist/lib/models/augmented-compilation.js +4 -0
  52. package/dist/lib/models/i18n.d.ts +33 -0
  53. package/dist/lib/models/i18n.d.ts.map +1 -0
  54. package/dist/lib/models/i18n.js +41 -0
  55. package/dist/lib/models/index.d.ts +5 -0
  56. package/dist/lib/models/index.d.ts.map +1 -0
  57. package/dist/lib/models/index.js +7 -0
  58. package/dist/lib/models/normalize-options.d.ts +16 -0
  59. package/dist/lib/models/normalize-options.d.ts.map +1 -0
  60. package/dist/lib/models/normalize-options.js +424 -0
  61. package/dist/lib/plugins/angular-rspack-plugin.d.ts +9 -0
  62. package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -0
  63. package/dist/lib/plugins/angular-rspack-plugin.js +234 -0
  64. package/dist/lib/plugins/angular-ssr-dev-server.d.ts +8 -0
  65. package/dist/lib/plugins/angular-ssr-dev-server.d.ts.map +1 -0
  66. package/dist/lib/plugins/angular-ssr-dev-server.js +62 -0
  67. package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts +19 -0
  68. package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts.map +1 -0
  69. package/dist/lib/plugins/any-component-style-budget-checker-plugin.js +64 -0
  70. package/dist/lib/plugins/client/ssr-reload-client.d.ts +2 -0
  71. package/dist/lib/plugins/client/ssr-reload-client.d.ts.map +1 -0
  72. package/dist/lib/plugins/client/ssr-reload-client.js +15 -0
  73. package/dist/lib/plugins/i18n-inline-plugin.d.ts +8 -0
  74. package/dist/lib/plugins/i18n-inline-plugin.d.ts.map +1 -0
  75. package/dist/lib/plugins/i18n-inline-plugin.js +201 -0
  76. package/dist/lib/plugins/index-html-plugin.d.ts +21 -0
  77. package/dist/lib/plugins/index-html-plugin.d.ts.map +1 -0
  78. package/dist/lib/plugins/index-html-plugin.js +107 -0
  79. package/dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts +3 -0
  80. package/dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts.map +1 -0
  81. package/dist/lib/plugins/loaders/angular-partial-transform.loader.js +39 -0
  82. package/dist/lib/plugins/loaders/angular-transform.loader.d.ts +7 -0
  83. package/dist/lib/plugins/loaders/angular-transform.loader.d.ts.map +1 -0
  84. package/dist/lib/plugins/loaders/angular-transform.loader.js +40 -0
  85. package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts +11 -0
  86. package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts.map +1 -0
  87. package/dist/lib/plugins/loaders/hmr-accept-loader.js +24 -0
  88. package/dist/lib/plugins/loaders/hmr-accept.d.ts +9 -0
  89. package/dist/lib/plugins/loaders/hmr-accept.d.ts.map +1 -0
  90. package/dist/lib/plugins/loaders/hmr-accept.js +183 -0
  91. package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts +5 -0
  92. package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts.map +1 -0
  93. package/dist/lib/plugins/loaders/platform-server-exports.loader.js +18 -0
  94. package/dist/lib/plugins/ng-rspack.d.ts +13 -0
  95. package/dist/lib/plugins/ng-rspack.d.ts.map +1 -0
  96. package/dist/lib/plugins/ng-rspack.js +134 -0
  97. package/dist/lib/plugins/prerender-plugin.d.ts +8 -0
  98. package/dist/lib/plugins/prerender-plugin.d.ts.map +1 -0
  99. package/dist/lib/plugins/prerender-plugin.js +216 -0
  100. package/dist/lib/plugins/progress-plugin.d.ts +12 -0
  101. package/dist/lib/plugins/progress-plugin.d.ts.map +1 -0
  102. package/dist/lib/plugins/progress-plugin.js +36 -0
  103. package/dist/lib/plugins/rxjs-esm-resolution.d.ts +5 -0
  104. package/dist/lib/plugins/rxjs-esm-resolution.d.ts.map +1 -0
  105. package/dist/lib/plugins/rxjs-esm-resolution.js +15 -0
  106. package/dist/lib/plugins/server/ssr-reload-server.d.ts +6 -0
  107. package/dist/lib/plugins/server/ssr-reload-server.d.ts.map +1 -0
  108. package/dist/lib/plugins/server/ssr-reload-server.js +21 -0
  109. package/dist/lib/plugins/stats-json-plugin.d.ts +14 -0
  110. package/dist/lib/plugins/stats-json-plugin.d.ts.map +1 -0
  111. package/dist/lib/plugins/stats-json-plugin.js +69 -0
  112. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts +5 -0
  113. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts.map +1 -0
  114. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.js +34 -0
  115. package/dist/lib/plugins/tools/dev-tools-ignore-plugin.d.ts +17 -0
  116. package/dist/lib/plugins/tools/dev-tools-ignore-plugin.d.ts.map +1 -0
  117. package/dist/lib/plugins/tools/dev-tools-ignore-plugin.js +57 -0
  118. package/dist/lib/plugins/tools/render-worker.d.ts +31 -0
  119. package/dist/lib/plugins/tools/render-worker.d.ts.map +1 -0
  120. package/dist/lib/plugins/tools/render-worker.js +105 -0
  121. package/dist/lib/plugins/tools/routes-extractor-worker.d.ts +21 -0
  122. package/dist/lib/plugins/tools/routes-extractor-worker.d.ts.map +1 -0
  123. package/dist/lib/plugins/tools/routes-extractor-worker.js +48 -0
  124. package/dist/lib/plugins/tools/worker-pool.d.ts +13 -0
  125. package/dist/lib/plugins/tools/worker-pool.d.ts.map +1 -0
  126. package/dist/lib/plugins/tools/worker-pool.js +23 -0
  127. package/dist/lib/plugins/transfer-size-plugin.d.ts +12 -0
  128. package/dist/lib/plugins/transfer-size-plugin.d.ts.map +1 -0
  129. package/dist/lib/plugins/transfer-size-plugin.js +49 -0
  130. package/dist/lib/plugins/watch-file-logs-plugin.d.ts +12 -0
  131. package/dist/lib/plugins/watch-file-logs-plugin.d.ts.map +1 -0
  132. package/dist/lib/plugins/watch-file-logs-plugin.js +27 -0
  133. package/dist/lib/utils/async-chunks.d.ts +17 -0
  134. package/dist/lib/utils/async-chunks.d.ts.map +1 -0
  135. package/dist/lib/utils/async-chunks.js +44 -0
  136. package/dist/lib/utils/color.d.ts +11 -0
  137. package/dist/lib/utils/color.d.ts.map +1 -0
  138. package/dist/lib/utils/color.js +41 -0
  139. package/dist/lib/utils/find-project-for-path.d.ts +16 -0
  140. package/dist/lib/utils/find-project-for-path.d.ts.map +1 -0
  141. package/dist/lib/utils/find-project-for-path.js +42 -0
  142. package/dist/lib/utils/get-locale-base-href.d.ts +3 -0
  143. package/dist/lib/utils/get-locale-base-href.d.ts.map +1 -0
  144. package/dist/lib/utils/get-locale-base-href.js +17 -0
  145. package/dist/lib/utils/graph.d.ts +3 -0
  146. package/dist/lib/utils/graph.d.ts.map +1 -0
  147. package/dist/lib/utils/graph.js +25 -0
  148. package/dist/lib/utils/i18n.d.ts +4 -0
  149. package/dist/lib/utils/i18n.d.ts.map +1 -0
  150. package/dist/lib/utils/i18n.js +25 -0
  151. package/dist/lib/utils/index-file/add-body-script.d.ts +2 -0
  152. package/dist/lib/utils/index-file/add-body-script.d.ts.map +1 -0
  153. package/dist/lib/utils/index-file/add-body-script.js +15 -0
  154. package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts +9 -0
  155. package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts.map +1 -0
  156. package/dist/lib/utils/index-file/add-event-dispatch-contract.js +27 -0
  157. package/dist/lib/utils/index-file/get-index-input-file.d.ts +3 -0
  158. package/dist/lib/utils/index-file/get-index-input-file.d.ts.map +1 -0
  159. package/dist/lib/utils/index-file/get-index-input-file.js +9 -0
  160. package/dist/lib/utils/index-file/get-index-output-file.d.ts +3 -0
  161. package/dist/lib/utils/index-file/get-index-output-file.d.ts.map +1 -0
  162. package/dist/lib/utils/index-file/get-index-output-file.js +10 -0
  163. package/dist/lib/utils/index-file/html-rewriting-stream.d.ts +16 -0
  164. package/dist/lib/utils/index-file/html-rewriting-stream.d.ts.map +1 -0
  165. package/dist/lib/utils/index-file/html-rewriting-stream.js +27 -0
  166. package/dist/lib/utils/max-workers.d.ts +2 -0
  167. package/dist/lib/utils/max-workers.d.ts.map +1 -0
  168. package/dist/lib/utils/max-workers.js +21 -0
  169. package/dist/lib/utils/misc-helpers.d.ts +7 -0
  170. package/dist/lib/utils/misc-helpers.d.ts.map +1 -0
  171. package/dist/lib/utils/misc-helpers.js +34 -0
  172. package/dist/lib/utils/postcss-cli-resources.d.ts +22 -0
  173. package/dist/lib/utils/postcss-cli-resources.d.ts.map +1 -0
  174. package/dist/lib/utils/postcss-cli-resources.js +159 -0
  175. package/dist/lib/utils/postcss-configuration.d.ts +18 -0
  176. package/dist/lib/utils/postcss-configuration.d.ts.map +1 -0
  177. package/dist/lib/utils/postcss-configuration.js +92 -0
  178. package/dist/lib/utils/rspack-diagnostics.d.ts +4 -0
  179. package/dist/lib/utils/rspack-diagnostics.d.ts.map +1 -0
  180. package/dist/lib/utils/rspack-diagnostics.js +22 -0
  181. package/dist/lib/utils/spinner.d.ts +21 -0
  182. package/dist/lib/utils/spinner.d.ts.map +1 -0
  183. package/dist/lib/utils/spinner.js +54 -0
  184. package/dist/lib/utils/stats.d.ts +35 -0
  185. package/dist/lib/utils/stats.d.ts.map +1 -0
  186. package/dist/lib/utils/stats.js +313 -0
  187. package/dist/lib/utils/tty.d.ts +9 -0
  188. package/dist/lib/utils/tty.d.ts.map +1 -0
  189. package/dist/lib/utils/tty.js +22 -0
  190. package/dist/lib/utils/url-join.d.ts +9 -0
  191. package/dist/lib/utils/url-join.d.ts.map +1 -0
  192. package/dist/lib/utils/url-join.js +17 -0
  193. package/package.json +150 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,98 @@
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 Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ <div style="text-align: center;">
9
+
10
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
+ [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
13
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
+ [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
17
+
18
+ </div>
19
+
20
+
21
+ <hr>
22
+
23
+ # Nx: Smart Repos · Fast Builds
24
+
25
+ An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
26
+
27
+ ## Build Angular with Rspack
28
+
29
+ The goal of `@nx/angular-rspack` is to make easy and straightforward to build Angular applications with [rspack](https://rspack.dev).
30
+
31
+ ### Getting Started
32
+
33
+ #### Step 1: Create a new Nx Workspace with Angular Rspack Application
34
+
35
+ ```bash
36
+ npx create-nx-workspace myorg
37
+
38
+ NX Let's create a new workspace [[https://nx.dev/getting-started/intro](https://nx.dev/getting-started/intro)]
39
+ ✔ Which stack do you want to use? · angular
40
+ ✔ Integrated monorepo, or standalone project? · integrated
41
+ ✔ Application name · myorg
42
+ ✔ Which bundler would you like to use? · rspack
43
+ ✔ Default stylesheet format · css
44
+ ✔ Do you want to enable Server-Side Rendering (SSR)? · No
45
+ ✔ Which unit test runner would you like to use? · vitest
46
+ ✔ Test runner to use for end to end (E2E) tests · playwright
47
+ ✔ Which CI provider would you like to use? · skip
48
+ ✔ Would you like remote caching to make your build faster? · skip
49
+ NX Creating your v20.8.0 workspace.
50
+ ```
51
+
52
+ #### Step 2: Run Build and Serve commands
53
+
54
+ ```bash
55
+ npx nx build myorg
56
+ npx nx serve myorg
57
+ ```
58
+
59
+ ## Getting Started
60
+
61
+ ### Creating an Nx Workspace
62
+
63
+ **Using `npx`**
64
+
65
+ ```bash
66
+ npx create-nx-workspace
67
+ ```
68
+
69
+ **Using `npm init`**
70
+
71
+ ```bash
72
+ npm init nx-workspace
73
+ ```
74
+
75
+ **Using `yarn create`**
76
+
77
+ ```bash
78
+ yarn create nx-workspace
79
+ ```
80
+
81
+ ### Adding Nx to an Existing Repository
82
+
83
+ Run:
84
+
85
+ ```bash
86
+ npx nx@latest init
87
+ ```
88
+
89
+ ## Documentation & Resources
90
+
91
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
92
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
93
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
94
+ - [Blog Posts About Nx](https://nx.dev/blog)
95
+
96
+ <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"
97
+ width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
98
+
@@ -0,0 +1,48 @@
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 Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ {{links}}
9
+
10
+ <hr>
11
+
12
+ # Nx: Smart Repos · Fast Builds
13
+
14
+ An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
15
+
16
+ ## Build Angular with Rspack
17
+
18
+ The goal of `@nx/angular-rspack` is to make easy and straightforward to build Angular applications with [rspack](https://rspack.dev).
19
+
20
+ ### Getting Started
21
+
22
+ #### Step 1: Create a new Nx Workspace with Angular Rspack Application
23
+
24
+ ```bash
25
+ npx create-nx-workspace myorg
26
+
27
+ NX Let's create a new workspace [[https://nx.dev/getting-started/intro](https://nx.dev/getting-started/intro)]
28
+ ✔ Which stack do you want to use? · angular
29
+ ✔ Integrated monorepo, or standalone project? · integrated
30
+ ✔ Application name · myorg
31
+ ✔ Which bundler would you like to use? · rspack
32
+ ✔ Default stylesheet format · css
33
+ ✔ Do you want to enable Server-Side Rendering (SSR)? · No
34
+ ✔ Which unit test runner would you like to use? · vitest
35
+ ✔ Test runner to use for end to end (E2E) tests · playwright
36
+ ✔ Which CI provider would you like to use? · skip
37
+ ✔ Would you like remote caching to make your build faster? · skip
38
+ NX Creating your v20.8.0 workspace.
39
+ ```
40
+
41
+ #### Step 2: Run Build and Serve commands
42
+
43
+ ```bash
44
+ npx nx build myorg
45
+ npx nx serve myorg
46
+ ```
47
+
48
+ {{content}}
@@ -0,0 +1,4 @@
1
+ import type { Configuration } from '@rspack/core';
2
+ import type { HashFormat, I18nOptions, NormalizedAngularRspackPluginOptions } from '../../models';
3
+ export declare function getBrowserConfig(normalizedOptions: NormalizedAngularRspackPluginOptions, i18n: I18nOptions, hashFormat: HashFormat, defaultConfig: Configuration): Promise<Configuration>;
4
+ //# sourceMappingURL=browser-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config-utils/browser-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,cAAc,CAAC;AAQtB,wBAAsB,gBAAgB,CACpC,iBAAiB,EAAE,oCAAoC,EACvD,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,aAAa,CAAC,CAgFxB"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBrowserConfig = getBrowserConfig;
4
+ const angular_rspack_compiler_1 = require("@nx/angular-rspack-compiler");
5
+ const ng_rspack_1 = require("../../plugins/ng-rspack");
6
+ const dev_server_config_utils_1 = require("./dev-server-config-utils");
7
+ const entry_points_1 = require("./entry-points");
8
+ const optimization_config_1 = require("./optimization-config");
9
+ const path_1 = require("path");
10
+ const hmr_accept_loader_1 = require("../../plugins/loaders/hmr-accept-loader");
11
+ async function getBrowserConfig(normalizedOptions, i18n, hashFormat, defaultConfig) {
12
+ const isDevServer = process.env['WEBPACK_SERVE'];
13
+ const isProduction = process.env['NODE_ENV'] === 'production';
14
+ const { root } = normalizedOptions;
15
+ return {
16
+ ...defaultConfig,
17
+ name: 'browser',
18
+ target: ['web', 'es2015'],
19
+ entry: {
20
+ main: {
21
+ import: [
22
+ ...(i18n.shouldInline ? ['@angular/localize/init'] : []),
23
+ normalizedOptions.browser,
24
+ ],
25
+ },
26
+ ...(0, entry_points_1.getPolyfillsEntry)(normalizedOptions.polyfills, normalizedOptions.aot),
27
+ ...(0, entry_points_1.toRspackEntries)(normalizedOptions.globalStyles, normalizedOptions.root, 'ngGlobalStyles'),
28
+ ...(0, entry_points_1.toRspackEntries)(normalizedOptions.globalScripts, normalizedOptions.root),
29
+ },
30
+ devServer: await (0, dev_server_config_utils_1.getDevServerConfig)(normalizedOptions, 'browser'),
31
+ output: {
32
+ ...defaultConfig.output,
33
+ hashFunction: isProduction ? 'xxhash64' : undefined,
34
+ path: normalizedOptions.outputPath.browser,
35
+ cssFilename: `[name]${hashFormat.file}.css`,
36
+ filename: `[name]${hashFormat.chunk}.js`,
37
+ chunkFilename: `[name]${hashFormat.chunk}.js`,
38
+ ...(isDevServer ? {} : { scriptType: 'module', module: true }),
39
+ },
40
+ resolve: {
41
+ ...defaultConfig.resolve,
42
+ mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
43
+ },
44
+ optimization: (0, optimization_config_1.getOptimization)(normalizedOptions, 'browser'),
45
+ module: {
46
+ ...defaultConfig.module,
47
+ rules: [
48
+ {
49
+ test: angular_rspack_compiler_1.TS_ALL_EXT_REGEX,
50
+ use: [
51
+ {
52
+ loader: 'builtin:swc-loader',
53
+ options: {
54
+ jsc: {
55
+ parser: {
56
+ syntax: 'typescript',
57
+ },
58
+ target: 'es2022',
59
+ },
60
+ },
61
+ },
62
+ ],
63
+ },
64
+ ...(normalizedOptions.devServer?.hmr
65
+ ? [
66
+ {
67
+ loader: hmr_accept_loader_1.HmrLoader,
68
+ include: [(0, path_1.resolve)(root, normalizedOptions.browser)],
69
+ },
70
+ ]
71
+ : []),
72
+ ...(defaultConfig.module?.rules ?? []),
73
+ ],
74
+ },
75
+ plugins: [
76
+ ...(defaultConfig.plugins ?? []),
77
+ new ng_rspack_1.NgRspackPlugin(normalizedOptions, {
78
+ i18nOptions: i18n,
79
+ platform: 'browser',
80
+ }),
81
+ ],
82
+ };
83
+ }
@@ -0,0 +1,3 @@
1
+ import { HashFormat, I18nOptions, NormalizedAngularRspackPluginOptions } from '../../models';
2
+ export declare function getCommonConfig(normalizedOptions: NormalizedAngularRspackPluginOptions, i18n: I18nOptions, i18nHash: string | (() => void), hashFormat: HashFormat): Promise<import("@rspack/core").RspackOptions>;
3
+ //# sourceMappingURL=common-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config-utils/common-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,UAAU,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,cAAc,CAAC;AAQtB,wBAAsB,eAAe,CACnC,iBAAiB,EAAE,oCAAoC,EACvD,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,EAC/B,UAAU,EAAE,UAAU,iDA6JvB"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCommonConfig = getCommonConfig;
4
+ const core_1 = require("@rspack/core");
5
+ const node_path_1 = require("node:path");
6
+ const angular_rspack_compiler_1 = require("@nx/angular-rspack-compiler");
7
+ const style_config_utils_1 = require("./style-config-utils");
8
+ const helpers_1 = require("./helpers");
9
+ const sourcemap_utils_1 = require("./sourcemap-utils");
10
+ const stats_json_plugin_1 = require("../../plugins/stats-json-plugin");
11
+ const watch_file_logs_plugin_1 = require("../../plugins/watch-file-logs-plugin");
12
+ const get_index_input_file_1 = require("../../utils/index-file/get-index-input-file");
13
+ async function getCommonConfig(normalizedOptions, i18n, i18nHash, hashFormat) {
14
+ const isDevServer = process.env['WEBPACK_SERVE'];
15
+ const crossOriginLoading = (0, helpers_1.getCrossOriginLoading)(normalizedOptions);
16
+ const sourceMapOptions = (0, sourcemap_utils_1.configureSourceMap)(normalizedOptions.sourceMap);
17
+ const stylesConfig = await (0, style_config_utils_1.getStylesConfig)(normalizedOptions, hashFormat, normalizedOptions.hasServer ? 'server' : 'browser');
18
+ const indexInputFile = (0, node_path_1.join)(normalizedOptions.root, (0, get_index_input_file_1.getIndexInputFile)(normalizedOptions.index));
19
+ const indexInputWatchPlugin = {
20
+ apply: (compiler) => {
21
+ compiler.hooks.thisCompilation.tap('build-angular', (compilation) => {
22
+ compilation.fileDependencies.add(indexInputFile);
23
+ });
24
+ },
25
+ };
26
+ const defaultConfig = {
27
+ context: normalizedOptions.root,
28
+ profile: normalizedOptions.statsJson,
29
+ mode: normalizedOptions.optimization.scripts ||
30
+ normalizedOptions.optimization.styles.minify
31
+ ? 'production'
32
+ : 'development',
33
+ devtool: normalizedOptions.sourceMap.scripts ? 'source-map' : false,
34
+ infrastructureLogging: {
35
+ appendOnly: false,
36
+ debug: normalizedOptions.verbose,
37
+ level: normalizedOptions.verbose ? 'verbose' : 'none',
38
+ },
39
+ performance: {
40
+ hints: false,
41
+ },
42
+ stats: 'none', // This is handled in the AngularRspackPlugin by the rspackStatsLogger
43
+ output: {
44
+ uniqueName: normalizedOptions.projectName ?? 'rspack-angular',
45
+ publicPath: normalizedOptions.deployUrl ?? '',
46
+ clean: false, // already taken care for by AngularRspackPlugin
47
+ crossOriginLoading,
48
+ trustedTypes: { policyName: 'angular#bundler' },
49
+ sourceMapFilename: normalizedOptions.sourceMap.scripts
50
+ ? '[file].map'
51
+ : undefined,
52
+ ...(isDevServer ? {} : { scriptType: 'module' }),
53
+ },
54
+ resolve: {
55
+ extensions: ['.ts', '.tsx', '.mjs', '.js'],
56
+ symlinks: !normalizedOptions.preserveSymlinks,
57
+ modules: ['node_modules'],
58
+ conditionNames: ['es2020', 'es2015', '...'],
59
+ tsConfig: {
60
+ configFile: normalizedOptions.tsConfig,
61
+ },
62
+ ...(i18n.shouldInline && normalizedOptions.aot
63
+ ? { alias: { '@angular/localize/init': false } }
64
+ : {}),
65
+ },
66
+ resolveLoader: {
67
+ symlinks: !normalizedOptions.preserveSymlinks,
68
+ },
69
+ watch: normalizedOptions.watch,
70
+ watchOptions: {
71
+ poll: normalizedOptions.poll,
72
+ followSymlinks: normalizedOptions.preserveSymlinks,
73
+ ignored: normalizedOptions.poll === undefined ? undefined : '**/node_modules/**',
74
+ },
75
+ ignoreWarnings: [
76
+ // https://github.com/webpack-contrib/source-map-loader/blob/b2de4249c7431dd8432da607e08f0f65e9d64219/src/index.js#L83
77
+ /Failed to parse source map from/,
78
+ // https://github.com/webpack-contrib/postcss-loader/blob/bd261875fdf9c596af4ffb3a1a73fe3c549befda/src/index.js#L153-L158
79
+ /Add postcss as project dependency/,
80
+ // esbuild will issue a warning, while still hoists the @charset at the very top.
81
+ // This is caused by a bug in css-loader https://github.com/webpack-contrib/css-loader/issues/1212
82
+ /"@charset" must be the first rule in the file/,
83
+ ],
84
+ module: {
85
+ parser: {
86
+ javascript: {
87
+ url: false,
88
+ },
89
+ },
90
+ rules: [
91
+ {
92
+ test: /\.?(svg|html)$/,
93
+ // Only process HTML and SVG which are known Angular component resources.
94
+ resourceQuery: /\?ngResource/,
95
+ type: 'asset/source',
96
+ },
97
+ ...stylesConfig.loaderRules,
98
+ ...sourceMapOptions.sourceMapRules,
99
+ { test: /[/\\]rxjs[/\\]add[/\\].+\.js$/, sideEffects: true },
100
+ {
101
+ test: angular_rspack_compiler_1.TS_ALL_EXT_REGEX,
102
+ use: [
103
+ {
104
+ loader: require.resolve('@nx/angular-rspack/loaders/angular-loader'),
105
+ },
106
+ ],
107
+ },
108
+ {
109
+ test: angular_rspack_compiler_1.JS_ALL_EXT_REGEX,
110
+ use: [
111
+ {
112
+ loader: require.resolve('@nx/angular-rspack/loaders/angular-partial-transform-loader'),
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ },
118
+ plugins: [
119
+ ...sourceMapOptions.sourceMapPlugins,
120
+ ...(normalizedOptions.verbose ? [new watch_file_logs_plugin_1.WatchFilesLogsPlugin()] : []),
121
+ ...(normalizedOptions.watch ? [indexInputWatchPlugin] : []),
122
+ ...(normalizedOptions.statsJson
123
+ ? [
124
+ new stats_json_plugin_1.StatsJsonPlugin((0, node_path_1.resolve)(normalizedOptions.root, normalizedOptions.outputPath.base, 'stats.json')),
125
+ ]
126
+ : []),
127
+ ...(i18n.shouldInline
128
+ ? [
129
+ {
130
+ apply(compiler) {
131
+ compiler.hooks.compilation.tap('AngularRspackPlugin', (compilation) => {
132
+ core_1.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).chunkHash.tap('AngularRspackPlugin', (_, hash) => {
133
+ hash.update(Buffer.from('$localize' + i18nHash));
134
+ });
135
+ });
136
+ },
137
+ },
138
+ ]
139
+ : []),
140
+ ...stylesConfig.plugins,
141
+ ],
142
+ };
143
+ return defaultConfig;
144
+ }
@@ -0,0 +1,4 @@
1
+ import type { DevServer } from '@rspack/core';
2
+ import type { NormalizedAngularRspackPluginOptions } from '../../models';
3
+ export declare function getDevServerConfig(options: NormalizedAngularRspackPluginOptions, platform: 'browser' | 'server'): Promise<DevServer>;
4
+ //# sourceMappingURL=dev-server-config-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server-config-utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config-utils/dev-server-config-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,cAAc,CAAC;AAIzE,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAC7B,OAAO,CAAC,SAAS,CAAC,CA2DpB"}