定制钩子


\Customization Hooks

版本历史
版本变更
v23.5.0, v22.15.0

添加对同步和线程内钩子的支持。

v20.6.0, v18.19.0

添加了 initialize 钩子来替换 globalPreload

v18.6.0, v16.17.0

添加对链接加载器的支持。

v16.12.0

删除了 getFormatgetSourcetransformSourceglobalPreload;添加了 load 钩子和 getGlobalPreload 钩子。

v8.8.0

新增于: v8.8.0

稳定性: 1.2 - 候选版本(异步版本)稳定性:1.1 - 主动开发(同步版本)

\Stability: 1.2 - Release candidate (asynchronous version) Stability: 1.1 - Active development (synchronous version)

目前支持两种类型的模块自定义钩子:

\There are two types of module customization hooks that are currently supported:

  1. module.register(specifier[, parentURL][, options]) 采用导出异步钩子函数的模块。这些函数在单独的加载器线程上运行。

    \module.register(specifier[, parentURL][, options]) which takes a module that exports asynchronous hook functions. The functions are run on a separate loader thread.

  2. module.registerHooks(options) 采用直接在加载模块的线程上运行的同步钩子函数。

    \module.registerHooks(options) which takes synchronous hook functions that are run directly on the thread where the module is loaded.

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