node-dev
node-dev copied to clipboard
[ESM] Support wrapping a custom loader
Closes #242
This adds support for custom ESM loaders options passed via --experimental-loader
to node-dev. I accomplish this by passing the resolved loader path as a query string argument to node-dev's own ESM loader implementation.
Also, keeping this as a draft until #279 is merged since those changes are more important and this branch builds on top of those commits.
This PR still doesn't solve scenarios where the ESM loader is passed via NODE_OPTIONS
, which is a problem for Yarn 2+ users. To make that work properly we need to rewrite process.env.NODE_OPTIONS
with the appropriate loader.
Would it be acceptable to always pass the rewritten loader path by appending a string onto process.env.NODE_OPTIONS
instead of passing it as a node arg?
Would it be acceptable to always pass the rewritten loader path by appending a string onto
process.env.NODE_OPTIONS
instead of passing it as a node arg?
node-dev should not be manipulating environment variables.