@@ -235,7 +235,7 @@ the `require.resolve()` function.
235
235
Putting together all of the above, here is the high-level algorithm
236
236
in pseudocode of what ` require() ` does:
237
237
238
- < pre >
238
+ ``` pre html
239
239
require(X) from module at path Y
240
240
1. If X is a core module,
241
241
a. return the core module
@@ -256,7 +256,7 @@ MAYBE_DETECT_AND_LOAD(X)
256
256
1. If X parses as a CommonJS module, load X as a CommonJS module. STOP.
257
257
2. Else, if `--experimental-require-module` and `--experimental-detect-module` are
258
258
enabled, and the source code of X can be parsed as ECMAScript module using
259
- <a href =" esm.md#resolver -algorithm-specification " >DETECT_MODULE_SYNTAX defined in
259
+ <a href="esm.md#resolution -algorithm-specification">DETECT_MODULE_SYNTAX defined in
260
260
the ESM resolver</a>,
261
261
a. Load X as an ECMAScript module. STOP.
262
262
3. THROW the SyntaxError from attempting to parse X as CommonJS in 1. STOP.
@@ -318,7 +318,7 @@ LOAD_PACKAGE_IMPORTS(X, DIR)
318
318
2. If no scope was found, return.
319
319
3. If the SCOPE/package.json "imports" is null or undefined, return.
320
320
4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE),
321
- ["node", "require"]) <a href =" esm.md#resolver -algorithm-specification " >defined in the ESM resolver</a >.
321
+ ["node", "require"]) <a href="esm.md#resolution -algorithm-specification">defined in the ESM resolver</a>.
322
322
5. RESOLVE_ESM_MATCH(MATCH).
323
323
324
324
LOAD_PACKAGE_EXPORTS(X, DIR)
@@ -329,7 +329,7 @@ LOAD_PACKAGE_EXPORTS(X, DIR)
329
329
3. Parse DIR/NAME/package.json, and look for "exports" field.
330
330
4. If "exports" is null or undefined, return.
331
331
5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH,
332
- `package.json` "exports", ["node", "require"]) <a href =" esm.md#resolver -algorithm-specification " >defined in the ESM resolver</a >.
332
+ `package.json` "exports", ["node", "require"]) <a href="esm.md#resolution -algorithm-specification">defined in the ESM resolver</a>.
333
333
6. RESOLVE_ESM_MATCH(MATCH)
334
334
335
335
LOAD_PACKAGE_SELF(X, DIR)
@@ -339,15 +339,15 @@ LOAD_PACKAGE_SELF(X, DIR)
339
339
4. If the SCOPE/package.json "name" is not the first segment of X, return.
340
340
5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE),
341
341
"." + X.slice("name".length), `package.json` "exports", ["node", "require"])
342
- <a href =" esm.md#resolver -algorithm-specification " >defined in the ESM resolver</a >.
342
+ <a href="esm.md#resolution -algorithm-specification">defined in the ESM resolver</a>.
343
343
6. RESOLVE_ESM_MATCH(MATCH)
344
344
345
345
RESOLVE_ESM_MATCH(MATCH)
346
346
1. let RESOLVED_PATH = fileURLToPath(MATCH)
347
347
2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension
348
348
format. STOP
349
349
3. THROW "not found"
350
- </ pre >
350
+ ```
351
351
352
352
## Caching
353
353
0 commit comments