@@ -148,7 +148,7 @@ the `require.resolve()` function. |
148 | 148 | Putting together all of the above, here is the high-level algorithm |
149 | 149 | in pseudocode of what `require()` does: |
150 | 150 |
|
151 | | -```text |
| 151 | +<pre> |
152 | 152 | require(X) from module at path Y |
153 | 153 | 1. If X is a core module, |
154 | 154 | a. return the core module |
@@ -210,7 +210,7 @@ LOAD_PACKAGE_IMPORTS(X, DIR) |
210 | 210 | 2. If no scope was found, return. |
211 | 211 | 3. If the SCOPE/package.json "imports" is null or undefined, return. |
212 | 212 | 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), |
213 | | - ["node", "require"]) defined in the ESM resolver. |
| 213 | + ["node", "require"]) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. |
214 | 214 | 5. RESOLVE_ESM_MATCH(MATCH). |
215 | 215 |
|
216 | 216 | LOAD_PACKAGE_EXPORTS(X, DIR) |
@@ -221,7 +221,7 @@ LOAD_PACKAGE_EXPORTS(X, DIR) |
221 | 221 | 3. Parse DIR/NAME/package.json, and look for "exports" field. |
222 | 222 | 4. If "exports" is null or undefined, return. |
223 | 223 | 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, |
224 | | - `package.json` "exports", ["node", "require"]) defined in the ESM resolver. |
| 224 | + `package.json` "exports", ["node", "require"]) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. |
225 | 225 | 6. RESOLVE_ESM_MATCH(MATCH) |
226 | 226 |
|
227 | 227 | LOAD_PACKAGE_SELF(X, DIR) |
@@ -231,7 +231,7 @@ LOAD_PACKAGE_SELF(X, DIR) |
231 | 231 | 4. If the SCOPE/package.json "name" is not the first segment of X, return. |
232 | 232 | 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), |
233 | 233 | "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) |
234 | | - defined in the ESM resolver. |
| 234 | + <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. |
235 | 235 | 6. RESOLVE_ESM_MATCH(MATCH) |
236 | 236 |
|
237 | 237 | RESOLVE_ESM_MATCH(MATCH) |
@@ -244,7 +244,7 @@ RESOLVE_ESM_MATCH(MATCH) |
244 | 244 | a. LOAD_AS_FILE(RESOLVED_PATH) |
245 | 245 | b. LOAD_AS_DIRECTORY(RESOLVED_PATH) |
246 | 246 | 5. THROW "not found" |
247 | | -``` |
| 247 | +</pre> |
248 | 248 |
|
249 | 249 | ## Caching |
250 | 250 |
|
|