From 5a15e7a093dc8e46451641a5016441cf92a8ef26 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Fri, 22 Jul 2022 10:12:51 +0300 Subject: [PATCH] esm: add `--experimental-import` flag --- doc/api/cli.md | 13 +++++++++++++ lib/internal/modules/run_main.js | 7 ++++++- lib/internal/process/esm_loader.js | 29 ++++++++++++++++++++--------- src/node_options.cc | 8 ++++++-- src/node_options.h | 4 +++- 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index f0a2e70b8d7b66..ddd6c005e28757 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -298,6 +298,17 @@ added: Expose the [Web Crypto API][] on the global scope. +### `--experimental-import=module` + + + +Preload the specified module at startup. + +Follows [ECMAScript modules][] resolution rules. +Use \[`--require`]\[] to load a \[CJS module]\[]. + ### `--experimental-import-meta-resolve`