定制钩子
🌐 Customization Hooks
稳定性: 1.2 - 候选版本(异步版本)
稳定性: 1.1 - 开发中(同步版本)
目前支持两种类型的模块自定义钩子:
🌐 There are two types of module customization hooks that are currently supported:
module.register(specifier[, parentURL][, options])接受一个导出异步钩子函数的模块。这些函数会在单独的加载器线程上运行。module.registerHooks(options)接受同步钩子函数,这些函数会在模块加载的线程上直接运行。