Commit 06df698
authored
fix(perf): lazy load glob on normalize.js (#89)
Since npm run didn't call those steps, we can save some `ms` by lazy
loading this dependency.
Before:

After:

The entire load time didn't change, still `13ms` before & after, but if
we call `npm run` inside a project that didn't have workspaces, we will
save some `ms`, like this one:

But this will also require the PR npm/cli#7360
to be merged.1 parent d4814d4 commit 06df698
1 file changed
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
| |||
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | | - | |
| 219 | + | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| |||
273 | 283 | | |
274 | 284 | | |
275 | 285 | | |
276 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
277 | 291 | | |
278 | 292 | | |
279 | 293 | | |
| |||
304 | 318 | | |
305 | 319 | | |
306 | 320 | | |
307 | | - | |
| 321 | + | |
308 | 322 | | |
309 | 323 | | |
310 | 324 | | |
| |||
317 | 331 | | |
318 | 332 | | |
319 | 333 | | |
320 | | - | |
| 334 | + | |
321 | 335 | | |
322 | 336 | | |
323 | 337 | | |
| |||
0 commit comments