| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -359,8 +359,7 @@ require(X) from module at path Y | |||
| 359 | 359 | MAYBE_DETECT_AND_LOAD(X) | |
| 360 | 360 | 1. If X parses as a CommonJS module, load X as a CommonJS module. STOP. | |
| 361 | 361 | 2. Else, if the source code of X can be parsed as ECMAScript module using | |
| 362 | - <a href="esm.md#resolver-algorithm-specification">DETECT_MODULE_SYNTAX defined in | ||
| 363 | - the ESM resolver</a>, | ||
| 362 | + DETECT_MODULE_SYNTAX defined in the ESM resolver, | ||
| 364 | 363 | a. Load X as an ECMAScript module. STOP. | |
| 365 | 364 | 3. THROW the SyntaxError from attempting to parse X as CommonJS in 1. STOP. | |
| 366 | 365 | ||
@@ -424,7 +423,7 @@ LOAD_PACKAGE_IMPORTS(X, DIR) | |||
| 424 | 423 | a. let CONDITIONS = ["node", "require", "module-sync"] | |
| 425 | 424 | b. Else, let CONDITIONS = ["node", "require"] | |
| 426 | 425 | 5. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), | |
| 427 | - CONDITIONS) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. | ||
| 426 | + CONDITIONS) defined in the ESM resolver. | ||
| 428 | 427 | 6. RESOLVE_ESM_MATCH(MATCH). | |
| 429 | 428 | ||
| 430 | 429 | LOAD_PACKAGE_EXPORTS(X, DIR) | |
@@ -438,7 +437,7 @@ LOAD_PACKAGE_EXPORTS(X, DIR) | |||
| 438 | 437 | a. let CONDITIONS = ["node", "require", "module-sync"] | |
| 439 | 438 | b. Else, let CONDITIONS = ["node", "require"] | |
| 440 | 439 | 6. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, | |
| 441 | - `package.json` "exports", CONDITIONS) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. | ||
| 440 | + `package.json` "exports", CONDITIONS) defined in the ESM resolver. | ||
| 442 | 441 | 7. RESOLVE_ESM_MATCH(MATCH) | |
| 443 | 442 | ||
| 444 | 443 | LOAD_PACKAGE_SELF(X, DIR) | |
@@ -448,7 +447,7 @@ LOAD_PACKAGE_SELF(X, DIR) | |||
| 448 | 447 | 4. If the SCOPE/package.json "name" is not the first segment of X, return. | |
| 449 | 448 | 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), | |
| 450 | 449 | "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) | |
| 451 | - <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>. | ||
| 450 | + defined in the ESM resolver. | ||
| 452 | 451 | 6. RESOLVE_ESM_MATCH(MATCH) | |
| 453 | 452 | ||
| 454 | 453 | RESOLVE_ESM_MATCH(MATCH) | |
@@ -458,6 +457,8 @@ RESOLVE_ESM_MATCH(MATCH) | |||
| 458 | 457 | 3. THROW "not found" | |
| 459 | 458 | ``` | |
| 460 | 459 | ||
| 460 | + The "ESM resolver" is defined [in the ESM documentation](esm.md#resolution-and-loading-algorithm). | ||
| 461 | + | ||
| 461 | 462 | ## Caching | |
| 462 | 463 | ||
| 463 | 464 | <!--type=misc--> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments