Skip to content

Remix Vite Express and Nodemon #9705

Closed Answered by jrestall-finact
matys1 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use a number of options, tsx is a very popular one such as used in the epic-web stack. ts-node is another popular option as seen in xHomu's template here.

A less popular option I personally really like is vite-node since it aligns with using vite for the dev server, can share vite config, use vite plugins and supports fast HMR of the server.ts code. Try them all and see which you prefer.

// package.json
"scripts": {
  "dev": "vite-node --watch ./server.ts"
  ...

One complexity with vite-node is that to support HMR you need to cleanup any resources before they are re-initialized on HMR in the "vite:beforeFullReload" hook, such as releasing server ports.

// server.ts

// Vite-Node H…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@matys1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by matys1
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jrestall
Comment options

@matys1
Comment options

@kiliman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants