Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build step #97

Open
cdtut opened this issue Nov 16, 2023 · 4 comments
Open

Build step #97

cdtut opened this issue Nov 16, 2023 · 4 comments

Comments

@cdtut
Copy link

cdtut commented Nov 16, 2023

Can someone explain how it works that no build step is needed to use JSX in node? In other frameworks build step is needed to turn JSX into js.

@yusukebe
Copy link
Member

@cdtut

Actually, you need build steps for your app using Hono's JSX. If you are using the starter template, you don't mind build steps because it uses the tsx which include the esbuild to build.

@carlos-duran
Copy link

Hello @yusukebe, I have the same doubt. What I understand from your answer is that the Node.js starter template (with tsx in the start script) can be used for production out of the box, right?

Thank you, Hono is really cool 😎

@yusukebe
Copy link
Member

Hi @carlos-duran,

Whether to use [tsx](https://github.com/privatenumber/tsx) in production depends on you. But, I don't recommend it. You can transpile to pure JavaScript files using tsc or esbuild and then run them with the node command.

@sureshbala
Copy link

sureshbala commented Aug 16, 2024

I think the build step needs to be clarified. I have used tsc and followed the steps mentioned in the documentation but unable to run the project for the following reason

tsc converts the files to .js extension but it does not include the .js extension in the relevant import statements.

Please check the screenshot attached. In the screenshot you can see that the index.js file contains imports without .js file extension

Screenshot 2024-08-16 at 11 26 42 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants