0

I'm wondering if there is a simple way to use Vite's Hot Module Replacement for a development server in Node.js (without using Express or any other framework, just plain Node.js). Just like webpack HMR with Nest.js.

The documentation of Vite isn't too helpful in case of backend HMR.

I have searched many packages like vite-plugin-node but these require writing special adapters and installing additional packages.

Can I use Vite's HMR with Node.js for backend code, without installing any third-party packages / plugins? How to configure Vite for that?

Additional information:

  • I'm using TypeScript
dominiq007
  • 45
  • 2
  • 4
  • 1
    You can't pull execute javascript from v8 engine. In cjs , you can remove cache but it doesn't work with esm. It cause memory leak. try this [hot-import](https://www.npmjs.com/package/hot-import) Use built-in feature : node --watch server.js – Anil kumar Dec 07 '22 at 08:15
  • related: https://stackoverflow.com/questions/56351312/hot-module-replacement-for-native-es-modules-browser-or-node-js – Bergi May 22 '23 at 23:13

0 Answers0