Commit 432302f
committed
perf(@angular/cli): avoid eager module loading during global bootstrap
Avoid importing `isWarningEnabled` and `colors` statically in `init.ts`.
Eagerly importing `config.ts` causes `@angular-devkit/core` and its transitive
dependencies (`rxjs`, `ajv`, `jsonc-parser`, and schema registries) to be
evaluated synchronously in the global CLI context before resolving the project
local CLI.
By lazily importing `config.ts` and `color.ts` only when `isGlobalGreater` is
true and a version mismatch warning needs to be issued, cold CLI invocations
avoid evaluating these packages globally during bootstrap.1 parent a6ef9cf commit 432302f
1 file changed
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
0 commit comments