For the Swagger UI I used a dynamic import so the script gets split into its own chunk, and only gets loaded on the relevant page.
For the installer version, the imported module is really small so a dynamic import was not needed. As for the "condition", I noticed the Astro doc was suggesting web components to implement custom behaviour, and I figured it would do a decent job at structuring the code, so I used this instead of a basic getElementById.
For the Swagger UI I used a dynamic import so the script gets split into its own chunk, and only gets loaded on the relevant page. For the installer version, the imported module is really small so a dynamic import was not needed. As for the "condition", I noticed the Astro doc was suggesting web components to implement custom behaviour, and I figured it would do a decent job at structuring the code, so I used this instead of a basic
getElementById
.fixes #215 fixes #216
See preview on Cloudflare Pages: https://preview-217.quiltmc-org.pages.dev