nodejs / loaders

ECMAScript Modules Loaders
MIT License
115 stars 16 forks source link

Differentiate between dynamic and static imports in loader hooks #204

Open thetutlage opened 2 weeks ago

thetutlage commented 2 weeks ago

We have a very specific use-case for ESM loader hooks that we are using here with https://github.com/Julien-R44/hot-hook

hot-hook is an ESM loader that enables HMR for Node.js apps without performing any bundling or static analysis of the code.

However, hot-hook can only work with dynamic imports and hence it becomes super crictical for us to differentiate between static and dynamic imports.

Since, loader hooks are under active development, we thought to share our use-case and see if it makes broader sense for Node.js to support this.

GeoffreyBooth commented 2 weeks ago

Related: #205