-r,--require 模块


🌐 -r, --require module

版本历史
版本变更
v23.0.0, v22.12.0, v20.19.0

This option also supports ECMAScript module.

v1.6.0

新增于: v1.6.0

在启动时预加载指定的模块。

🌐 Preload the specified module at startup.

遵循 require() 的模块解析规则。module 可以是文件路径,也可以是节点模块名称。

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

使用 --require 预加载的模块会在使用 --import 预加载的模块之前运行。

🌐 Modules preloaded with --require will run before modules preloaded with --import.

模块会被预加载到主线程以及任何工作线程、派生进程或集群进程中。

🌐 Modules are preloaded into the main thread as well as any worker threads, forked processes, or clustered processes.

AltStyle によって変換されたページ (->オリジナル) /