File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,18 @@ argument to the resolver for easy compatibility workflows.
129129
130130In addition to returning the resolved file URL value, the resolve hook also
131131returns a ` format ` property specifying the module format of the resolved
132- module. This can be one of ` "esm" ` , ` "cjs" ` , ` "json" ` , ` "builtin" ` or
133- ` "addon" ` .
132+ module. This can be one of the following:
134133
135- For example a dummy loader to load JavaScript restricted to browser resolution
134+ | ` format ` | Description |
135+ | --- | --- |
136+ | ` "esm" ` | Load a standard JavaScript module |
137+ | ` "cjs" ` | Load a node-style CommonJS module |
138+ | ` "builtin" ` | Load a node builtin CommonJS module |
139+ | ` "json" ` | Load a JSON file |
140+ | ` "addon" ` | Load a [ C++ Addon] [ addons ] |
141+ | ` "dynamic" ` | Use a [ dynamic instantiate hook] [ ] |
142+
143+ For example, a dummy loader to load JavaScript restricted to browser resolution
136144rules with only JS file extension and Node builtin modules support could
137145be written:
138146
@@ -206,3 +214,5 @@ then be called at the exact point of module evalutation order for that module
206214in the import tree.
207215
208216[ Node.js EP for ES Modules ] : https://github.com/nodejs/node-eps/blob/master/002-es-modules.md
217+ [ addons ] : addons.html
218+ [ dynamic instantiate hook ] : #esm_dynamic_instantiate_hook
You can’t perform that action at this time.
0 commit comments