Commit fec106b
committed
fix(@angular/build): enhance Vitest dependency externalization and pre-bundling
This commit refactors the dependency handling for the Vitest runner to improve flexibility and correctness, especially for browser-based tests.
The previously hardcoded list of external Angular packages has been removed. Instead, a new `externalPackages: true` option is passed to the application builder, allowing for more dynamic and configurable externalization of packages. This prevents packages from `node_modules` from being bundled into the test entry points.
Note: For cases where a dependency should not be pre-bundled, the `optimizeDeps.exclude` option can be used within a custom runner configuration file.
(cherry picked from commit 6e0f5da)1 parent dea6ced commit fec106b
File tree
2 files changed
+8
-21
lines changed- packages/angular/build/src/builders/unit-test/runners/vitest
2 files changed
+8
-21
lines changedLines changed: 7 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 17 | | |
33 | 18 | | |
34 | 19 | | |
| |||
110 | 95 | | |
111 | 96 | | |
112 | 97 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 98 | + | |
| 99 | + | |
116 | 100 | | |
117 | | - | |
| 101 | + | |
118 | 102 | | |
119 | 103 | | |
120 | 104 | | |
| |||
135 | 119 | | |
136 | 120 | | |
137 | 121 | | |
138 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
139 | 126 | | |
140 | 127 | | |
141 | 128 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
0 commit comments