Commit 9357ace
committed
fix(icon): bundle docs navigation icons to prevent client-nav flash
Docs nav icons render in @nuxt/icon CSS mode. On initial load their mask CSS
is inlined via SSR, but on client-side navigation the icon data isn't in the
client bundle, so it's fetched from the iconify API and the rule is injected
after paint — a visible flash.
The icons used only by the remote nuxt/nuxt docs nav (md frontmatter
`navigation.icon` + `.navigation.yml`) can't be collected automatically:
- the scanner skips the `.data` dot-dir (remote docs), and
- @nuxt/content restores its cache on CI (0 files parsed), so parse hooks and
raw-file globbing both come up empty at build time.
Inline just those remote-only icons (validated against the installed
@iconify-json packages). Local content (deploy, blog, …) and app icons stay
covered by `scan`; widen its glob to include `.ts` and `**/.*.{yml,yaml}`
so app config and local `.navigation.yml` dotfiles are picked up too.
Verified: client bundle 215 -> 262 icons (143.57KB, under the 256KB limit),
including all folder-type/file-type docs nav icons; local icons (azure, blog
nav) confirmed still bundled via the scanner.1 parent d0ce856 commit 9357ace
1 file changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
557 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
558 | 586 | | |
559 | 587 | | |
560 | 588 | | |
| |||
0 commit comments