Commit 0404f24
committed
chore: shave ~1-2s off
`pnpm test:types` runs `nuxt prepare` before `vue-tsc`. In this repo, `nuxt prepare`
does not just generate `.nuxt` files, it loads `nuxt.config.ts`, installs modules,
and runs each module's `setup()`.
The `blog` module's `setup()` calls `loadBlogPosts()`, which calls `fetchBlueskyAvatars()`, which
hits the Bluesky API to fetch user avatars and writes those to disk. None of that is needed for type
gen or type checking. The blog already gracefully handles missing avatars.
We already had a pattern to conditionally skip expensive work during prepare. This uses the same
pattern here.
This does not break the actual blog build, because nuxt runs modules' `setup()` during build.pnpm test:types
1 parent eb2e6bb commit 0404f24
1 file changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
123 | | - | |
124 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
| |||
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| 162 | + | |
153 | 163 | | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
159 | | - | |
| 169 | + | |
160 | 170 | | |
161 | 171 | | |
162 | 172 | | |
| |||
180 | 190 | | |
181 | 191 | | |
182 | 192 | | |
183 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
184 | 197 | | |
185 | 198 | | |
186 | 199 | | |
| |||
0 commit comments