Commit 7491c3d
refactor(@angular/build): optimize vitest in-memory file loading
This commit optimizes the 'angular:test-in-memory-provider' Vitest plugin by introducing a 'loadResultFile' helper. This helper utilizes 'TextDecoder' to decode memory files, avoiding unnecessary buffer copies associated with 'Buffer.from().toString()'. It also removes duplicate file reading logic for source maps.
(cherry picked from commit 09e5e32)1 parent decb3bd commit 7491c3d
File tree
1 file changed
+10
-9
lines changed- packages/angular/build/src/builders/unit-test/runners/vitest
1 file changed
+10
-9
lines changedLines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
| |||
221 | 229 | | |
222 | 230 | | |
223 | 231 | | |
| 232 | + | |
224 | 233 | | |
225 | 234 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
0 commit comments