Skip to content
John-David Dalton edited this page Mar 29, 2019 · 1 revision

Compile esm into Node

  • Clone the Node repository

    git clone --depth=1 https://github.com/nodejs/node
  • Perform the following code modifications (see commit)

    • Copy esm.js and esm/ from esm to lib/internal/
    • Add file paths to library_files in node.gyp
      'lib/internal/esm.js',
      'lib/internal/esm/loader.js',
    • Require internal/esm before loading preloadModules in lib/internal/bootstrap/pre_execution.js
      require('internal/esm');
  • Build Node in the repository (with Ninja)

    ./configure --ninja && ninja -C out/Release
  • Enjoy your Node build at out/Release/node

Clone this wiki locally