Skip to content
Open
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
7 changes: 6 additions & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2454,11 +2454,16 @@ changes:
description: This option also supports ECMAScript module.
-->

Preload the specified module at startup.
Preload the specified module at startup, before the main entry point
of the application is executed.
Comment on lines +2457 to +2458
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the other suggestion, we should remove it here to avoid duplication

Suggested change
Preload the specified module at startup, before the main entry point
of the application is executed.
Preload the specified module at startup.


Follows `require()`'s module resolution
rules. `module` may be either a path to a file, or a node module name.

This option is commonly used to initialize global configuration,
set up instrumentation, or apply polyfills before any application
code runs.

Modules preloaded with `--require` will run before modules preloaded with `--import`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's true that it's both before the entry point and before --import, but it might be worth giving the actual timeline

Suggested change
Modules preloaded with `--require` will run before modules preloaded with `--import`.
Modules preloaded with `--require` will run before modules preloaded with `--import`, which will run before the program entry point is executed.


Modules are preloaded into the main thread as well as any worker threads,
Expand Down