From 5a2a8aa1ce90258715223033ce9be4e398d86bbc Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 30 Sep 2023 09:15:56 +0200 Subject: [PATCH 1/2] module,src: add `--experimental-entry-url` flag --- doc/api/cli.md | 12 +++ lib/internal/main/run_main_module.js | 3 +- lib/internal/modules/run_main.js | 7 +- lib/internal/process/pre_execution.js | 4 +- src/node_options.cc | 4 + src/node_options.h | 1 + .../test-esm-loader-entry-is-url.mjs | 89 +++++++++++++++++++ 7 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 test/es-module/test-esm-loader-entry-is-url.mjs diff --git a/doc/api/cli.md b/doc/api/cli.md index 2c4e26dc1e407b..e15b48de3f705b 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -617,6 +617,17 @@ files with no extension will be treated as WebAssembly if they begin with the WebAssembly magic number (`\0asm`); otherwise they will be treated as ES module JavaScript. +### `--experimental-entry-url` + + + +> Stability: 1.0 - Early development + +When present, Node.js will interpret the entry point as a URL, rather than a path. + ### `--experimental-import-meta-resolve`