antfu / vite-node

Vite as Node.js runtime
MIT License
423 stars 9 forks source link

Auto-reload server #2

Open brillout opened 2 years ago

brillout commented 2 years ago

Is there any blocker for not supporting auto-reload? I believe it should be feasible with Vite's HMR with vite.ssrLoadModule().

Thanks for this neat project.

antfu commented 2 years ago

To be honest, I am not very familiar with SSR, this project was originally designed to run cli scripts (and then exit). I do implement a watch mode (-w) to provide a similar feature like nodemon but without shutting down the sever. Would love to have more info about your user case, or if you see it's feasible to do, PR is also greatly welcome!

brillout commented 2 years ago

Would love to have more info about your user case

Basically using vite-node instead of ts-node for https://github.com/brillout/vite-plugin-ssr/tree/master/boilerplates/boilerplate-vue-ts

PR is also greatly welcome!

Right now using ts-node is ok and changing that is not a top priority, but yea I may eventually PR :-)

antfu commented 2 years ago

Have you check esno or tsm? They use esbuild directly and should be faster than ts-node and vite-node.

brillout commented 2 years ago

Neat, I will check them out. Thanks :-)