repl: support --loader option in builtin REPL#33437
repl: support --loader option in builtin REPL#33437targos wants to merge 1 commit intonodejs:masterfrom
Conversation
|
With the example from the issue: With a wrong path: With error in the loader code: |
BridgeAR
left a comment
There was a problem hiding this comment.
I am fine with adding this feature. It would be good in general to support esm better in the REPL.
|
Maybe this is too heavy for this pr, but refactoring |
|
Ping @targos |
|
Updated with a different approach. PTAL. |
lib/internal/process/esm_loader.js
Outdated
There was a problem hiding this comment.
should probably gate this on ESMLoader being undefined
There was a problem hiding this comment.
do you mean add something like assert(ESMLoader === undefined) ?
There was a problem hiding this comment.
I can't. There's a default loader defined above, and removing it breaks things.
8ae28ff to
2935f72
Compare
|
Landed in 05539c1 |
|
@targos could you please backport this to |
Fixes: nodejs#33435 PR-URL: nodejs#33437 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Fixes: #33435
I'll try to write a test if there are no objections to the change.
/cc @nodejs/modules-active-members