node-dev icon indicating copy to clipboard operation
node-dev copied to clipboard

Port to ESM

Open kherock opened this issue 2 years ago • 0 comments

This ports all library code and tests to ESM. I left test fixtures as CJS and moved all CJS-hook related things into the require/ subfolder. I tried to keep everything functioning exactly as it did before aside from some other things I cleaned up:

  • replaced the NODE_DEV_PRELOAD env variable for the dedupe hook with a --require argument appended to execArgv
  • split wrap.js into multiple CJS require hooks patch.js, patch-fork.js, and patch-vm.js
    • This fixes the --vm CLI argument. Previously, wrap.js would only read from the config file and the CLI argument had no effect
  • added an exports map to package.json
  • specified files in package.json to optimize the overall package size
  • bumped the minimum Node version up to 14.8 (Node 12 is EOL)

Because of the new ≥14.8 requirement and the large amount of code churn, this should probably released as a new major version.

kherock avatar Mar 28 '22 02:03 kherock