hono icon indicating copy to clipboard operation
hono copied to clipboard

How can i bundle hono app with esbuild?

Open Sadaf-A opened this issue 1 year ago • 3 comments

I have been trying to bundle a hono app which uses jsx using esbuild. Can someone tell me the way to do this. I'm able to bundle but when i add that js file as script and run http-server it doesnt work as intended

Sadaf-A avatar Nov 11 '23 22:11 Sadaf-A

Could you provide the minimal code of what you are trying to do? I'd like to assist if I can.

chimame avatar Nov 12 '23 09:11 chimame

Could you provide the minimal code of what you are trying to do? I'd like to assist if I can.

It is a hono app based in node.js . I'm able to get the bundle.js file but i want to serve html pages I'm not sure how I can do that. Is there a way that i can bundle the html and css files and the ts code in a single file. I'm still working on this and making progress but any leads will be appreciated Thank You

Sadaf-A avatar Nov 12 '23 15:11 Sadaf-A

Are you trying to output static files, similar to static site generation? Or is it that you want to deliver HTML with server-side rendering from Hono, referencing JavaScript or CSS built with esbuild?

If you're aiming for something like static site generation, Hono may not be suitable for that purpose. Hono is primarily a web framework and should be thought of as something akin to Express or Fastify, not like Next.js.

If you're comfortable sharing, could you show the code of what you're trying to achieve, even in an intermediate state?

chimame avatar Nov 12 '23 16:11 chimame

I think we can close this issue.

If you have a question, please use GitHub Discussions or Discord. https://github.com/orgs/honojs/discussions

yusukebe avatar May 07 '24 09:05 yusukebe