Commit 4f96281
committed
perf: Self-host mermaid and load it only on pages with diagrams
Every page used to import mermaid (~2 MB of js) from cdn.jsdelivr.net
whether it contained a diagram or not. The mermaid-script partial now
checks for a .mermaid element and only then imports a self-hosted es
module build; mermaid's internal chunks lazy-load per diagram type.
The extension skips injecting its own script when the UI ships
partials/mermaid-script.hbs, so the mermaid_library_url/script_stem
playbook configuration is gone and no third-party CDN is involved.1 parent f19129f commit 4f96281
11 files changed
Lines changed: 1674 additions & 237 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
0 commit comments