Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: enable dynamic import flag for esmodules #18387

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ node --experimental-modules my-app.mjs
### Supported

Only the CLI argument for the main entry point to the program can be an entry
point into an ESM graph. Dynamic import can also be used with the flag
`--harmony-dynamic-import` to create entry points into ESM graphs at runtime.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Dynamic import can also be used to create entry points into ESM graphs at runtime."

point into an ESM graph. Dynamic import can also be used to create entry points
into ESM graphs at runtime.

### Unsupported

Expand Down
2 changes: 2 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3678,6 +3678,8 @@ static void ParseArgs(int* argc,
config_preserve_symlinks = true;
} else if (strcmp(arg, "--experimental-modules") == 0) {
config_experimental_modules = true;
new_v8_argv[new_v8_argc] = "--harmony-dynamic-import";
new_v8_argc += 1;
} else if (strcmp(arg, "--experimental-vm-modules") == 0) {
config_experimental_vm_modules = true;
} else if (strcmp(arg, "--loader") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/es-module/test-esm-dynamic-import.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --experimental-modules --harmony-dynamic-import
// Flags: --experimental-modules
'use strict';
const common = require('../common');
const assert = require('assert');
Expand Down