Using honox client.ts to load web components
I'm using honox client.ts to load web components I created in Lit. It works great but only when I have at least one island on the route. How can I make sure the js is loaded even when I don't have island on the route.
I'm using
<Script src='/app/client.ts' async />
in my _renderer.tsx file`6 Replies
Check the honox docs, react renderer part, it describes the manual <script> tags to use (lowercase S)
thanks I'll give it a try
Oh, before the react part, you can just use the lowercase script tags

Take out has islands and there you go
As I have a hashed version of the script file, I ended up copying https://github.com/honojs/honox/blob/main/src/server/components/script.tsx#L33 and removing the
<HasIslands>
check from the code.
Thank you.
it might be a good idea to allow to enable disable the <HasIslands>
from the Script
component props. I can make a PR if it makes senseGitHub
honox/src/server/components/script.tsx at main · honojs/honox
HonoX - Hono based meta framework. Contribute to honojs/honox development by creating an account on GitHub.