mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
module: subpath folder mappings EOL
PR-URL: https://github.com/nodejs/node/pull/40121 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
1 parent
0991dfcece
commit
36e2ffe6dc
11 files changed
+81
-237
No files matched your search
@@ -2707,6 +2707,9 @@ Use `fs.rm(path, { recursive: true, force: true })`,
|
|||||||
### DEP0148: Folder mappings in `"exports"` (trailing `"/"`)
|
### DEP0148: Folder mappings in `"exports"` (trailing `"/"`)
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/40121
|
||||||
|
description: End-of-Life.
|
||||||
- version: v16.0.0
|
- version: v16.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/37215
|
pr-url: https://github.com/nodejs/node/pull/37215
|
||||||
description: Runtime deprecation.
|
description: Runtime deprecation.
|
||||||
@@ -2720,9 +2723,9 @@ changes:
|
|||||||
|
|
||||||
Type: Runtime
|
Type: Runtime
|
||||||
|
|
||||||
Using a trailing `"/"` to define
|
Using a trailing `"/"` to define subpath folder mappings in the
|
||||||
[subpath folder mappings][] in the [subpath exports][] or
|
[subpath exports][] or [subpath imports][] fields is deprecated. Use
|
||||||
[subpath imports][] fields is deprecated. Use [subpath patterns][] instead.
|
[subpath patterns][] instead.
|
||||||
|
|
||||||
### DEP0149: `http.IncomingMessage#connection`
|
### DEP0149: `http.IncomingMessage#connection`
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
@@ -2965,6 +2968,5 @@ for package `"exports"` and `"imports"` pattern resolutions.
|
|||||||
[legacy `urlObject`]: url.md#legacy-urlobject
|
[legacy `urlObject`]: url.md#legacy-urlobject
|
||||||
[static methods of `crypto.Certificate()`]: crypto.md#class-certificate
|
[static methods of `crypto.Certificate()`]: crypto.md#class-certificate
|
||||||
[subpath exports]: packages.md#subpath-exports
|
[subpath exports]: packages.md#subpath-exports
|
||||||
[subpath folder mappings]: packages.md#subpath-folder-mappings
|
|
||||||
[subpath imports]: packages.md#subpath-imports
|
[subpath imports]: packages.md#subpath-imports
|
||||||
[subpath patterns]: packages.md#subpath-patterns
|
[subpath patterns]: packages.md#subpath-patterns
|
||||||
+31
-51
@@ -1068,9 +1068,8 @@ The resolver can throw the following errors:
|
|||||||
> 1. Set _resolved_ to the URL resolution of _specifier_ relative to
|
> 1. Set _resolved_ to the URL resolution of _specifier_ relative to
|
||||||
> _parentURL_.
|
> _parentURL_.
|
||||||
> 1. Otherwise, if _specifier_ starts with _"#"_, then
|
> 1. Otherwise, if _specifier_ starts with _"#"_, then
|
||||||
> 1. Set _resolved_ to the destructured value of the result of
|
> 1. Set _resolved_ to the result of **PACKAGE_IMPORTS_RESOLVE**(_specifier_,
|
||||||
> **PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_,
|
> _parentURL_, _defaultConditions_).
|
||||||
> _defaultConditions_).
|
|
||||||
> 1. Otherwise,
|
> 1. Otherwise,
|
||||||
> 1. Note: _specifier_ is now a bare specifier.
|
> 1. Note: _specifier_ is now a bare specifier.
|
||||||
> 1. Set _resolved_ the result of
|
> 1. Set _resolved_ the result of
|
||||||
@@ -1103,7 +1102,7 @@ The resolver can throw the following errors:
|
|||||||
> 1. If _packageName_ starts with _"."_ or contains _"\\"_ or _"%"_, then
|
> 1. If _packageName_ starts with _"."_ or contains _"\\"_ or _"%"_, then
|
||||||
> 1. Throw an _Invalid Module Specifier_ error.
|
> 1. Throw an _Invalid Module Specifier_ error.
|
||||||
> 1. Let _packageSubpath_ be _"."_ concatenated with the substring of
|
> 1. Let _packageSubpath_ be _"."_ concatenated with the substring of
|
||||||
> _packageSpecifier_ from the position at the length of _packageName_.
|
> _packageSpecifier_ from the position at the length of _packageName_.
|
||||||
> 1. Let _selfUrl_ be the result of
|
> 1. Let _selfUrl_ be the result of
|
||||||
> **PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_).
|
> **PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_).
|
||||||
> 1. If _selfUrl_ is not **undefined**, return _selfUrl_.
|
> 1. If _selfUrl_ is not **undefined**, return _selfUrl_.
|
||||||
@@ -1121,11 +1120,10 @@ The resolver can throw the following errors:
|
|||||||
> 1. If _pjson_ is not **null** and _pjson_._exports_ is not **null** or
|
> 1. If _pjson_ is not **null** and _pjson_._exports_ is not **null** or
|
||||||
> **undefined**, then
|
> **undefined**, then
|
||||||
> 1. Let _exports_ be _pjson.exports_.
|
> 1. Let _exports_ be _pjson.exports_.
|
||||||
> 1. Return the _resolved_ destructured value of the result of
|
> 1. Return the result of **PACKAGE_EXPORTS_RESOLVE**(_packageURL_,
|
||||||
> **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _packageSubpath_,
|
> _packageSubpath_, _pjson.exports_, _defaultConditions_).
|
||||||
> _pjson.exports_, _defaultConditions_).
|
|
||||||
> 1. Otherwise, if _packageSubpath_ is equal to _"."_, then
|
> 1. Otherwise, if _packageSubpath_ is equal to _"."_, then
|
||||||
> 1. Return the result applying the legacy **LOAD_AS_DIRECTORY**
|
> 1. Return the result of applying the legacy **LOAD_AS_DIRECTORY**
|
||||||
> CommonJS resolver to _packageURL_, throwing a _Module Not Found_
|
> CommonJS resolver to _packageURL_, throwing a _Module Not Found_
|
||||||
> error for no resolution.
|
> error for no resolution.
|
||||||
> 1. Otherwise,
|
> 1. Otherwise,
|
||||||
@@ -1142,13 +1140,14 @@ The resolver can throw the following errors:
|
|||||||
> **undefined**, then
|
> **undefined**, then
|
||||||
> 1. Return **undefined**.
|
> 1. Return **undefined**.
|
||||||
> 1. If _pjson.name_ is equal to _packageName_, then
|
> 1. If _pjson.name_ is equal to _packageName_, then
|
||||||
> 1. Return the _resolved_ destructured value of the result of
|
> 1. Return the result of **PACKAGE_EXPORTS_RESOLVE**(_packageURL_,
|
||||||
> **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _pjson.exports_,
|
> _subpath_, _pjson.exports_, _defaultConditions_).
|
||||||
> _defaultConditions_).
|
|
||||||
> 1. Otherwise, return **undefined**.
|
> 1. Otherwise, return **undefined**.
|
||||||
|
|
||||||
**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
|
**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
|
||||||
|
|
||||||
|
> 1. If _subpath_ ends in _"/"_, then
|
||||||
|
> 1. Throw an _Invalid Module Specifier_ error.
|
||||||
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
|
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
|
||||||
> starting with _"."_, throw an _Invalid Package Configuration_ error.
|
> starting with _"."_, throw an _Invalid Package Configuration_ error.
|
||||||
> 1. If _subpath_ is equal to _"."_, then
|
> 1. If _subpath_ is equal to _"."_, then
|
||||||
@@ -1162,53 +1161,45 @@ The resolver can throw the following errors:
|
|||||||
> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**(
|
> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**(
|
||||||
> _packageURL_, _mainExport_, _""_, **false**, **false**,
|
> _packageURL_, _mainExport_, _""_, **false**, **false**,
|
||||||
> _conditions_).
|
> _conditions_).
|
||||||
> 1. If _resolved_ is not **null** or **undefined**, then
|
> 1. If _resolved_ is not **null** or **undefined**, return _resolved_.
|
||||||
> 1. Return _resolved_.
|
|
||||||
> 1. Otherwise, if _exports_ is an Object and all keys of _exports_ start with
|
> 1. Otherwise, if _exports_ is an Object and all keys of _exports_ start with
|
||||||
> _"."_, then
|
> _"."_, then
|
||||||
> 1. Let _matchKey_ be the string _"./"_ concatenated with _subpath_.
|
> 1. Let _matchKey_ be the string _"./"_ concatenated with _subpath_.
|
||||||
> 1. Let _resolvedMatch_ be result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**(
|
> 1. Let _resolved_ be the result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**(
|
||||||
> _matchKey_, _exports_, _packageURL_, **false**, _conditions_).
|
> _matchKey_, _exports_, _packageURL_, **false**, _conditions_).
|
||||||
> 1. If _resolvedMatch_._resolve_ is not **null** or **undefined**, then
|
> 1. If _resolved_ is not **null** or **undefined**, return _resolved_.
|
||||||
> 1. Return _resolvedMatch_.
|
|
||||||
> 1. Throw a _Package Path Not Exported_ error.
|
> 1. Throw a _Package Path Not Exported_ error.
|
||||||
|
|
||||||
**PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_, _conditions_)
|
**PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_, _conditions_)
|
||||||
|
|
||||||
> 1. Assert: _specifier_ begins with _"#"_.
|
> 1. Assert: _specifier_ begins with _"#"_.
|
||||||
> 1. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then
|
> 1. If _specifier_ is exactly equal to _"#"_, starts with _"#/"_, or ends in
|
||||||
|
> _"/"_, then
|
||||||
> 1. Throw an _Invalid Module Specifier_ error.
|
> 1. Throw an _Invalid Module Specifier_ error.
|
||||||
> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_).
|
> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_).
|
||||||
> 1. If _packageURL_ is not **null**, then
|
> 1. If _packageURL_ is not **null**, then
|
||||||
> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_).
|
> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_).
|
||||||
> 1. If _pjson.imports_ is a non-null Object, then
|
> 1. If _pjson.imports_ is a non-null Object, then
|
||||||
> 1. Let _resolvedMatch_ be the result of
|
> 1. Let _resolved_ be the result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**(
|
||||||
> **PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_specifier_, _pjson.imports_,
|
> _specifier_, _pjson.imports_, _packageURL_, **true**, _conditions_).
|
||||||
> _packageURL_, **true**, _conditions_).
|
> 1. If _resolved_ is not **null** or **undefined**, return _resolved_.
|
||||||
> 1. If _resolvedMatch_._resolve_ is not **null** or **undefined**, then
|
|
||||||
> 1. Return _resolvedMatch_.
|
|
||||||
> 1. Throw a _Package Import Not Defined_ error.
|
> 1. Throw a _Package Import Not Defined_ error.
|
||||||
|
|
||||||
**PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
|
**PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
|
||||||
_isImports_, _conditions_)
|
_isImports_, _conditions_)
|
||||||
|
|
||||||
> 1. If _matchKey_ is a key of _matchObj_ and does not end in _"/"_ or contain
|
> 1. Assert: _matchKey_ does not end in _"/"_.
|
||||||
> _"*"_, then
|
> 1. If _matchKey_ is a key of _matchObj_ and does not contain _"*"_, then
|
||||||
> 1. Let _target_ be the value of _matchObj_\[_matchKey_\].
|
> 1. Let _target_ be the value of _matchObj_\[_matchKey_\].
|
||||||
> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**(
|
> 1. Return the result of **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_,
|
||||||
> _packageURL_, _target_, _""_, **false**, _isImports_, _conditions_).
|
> _""_, **false**, _isImports_, _conditions_).
|
||||||
> 1. Return the object _{ resolved, exact: **true** }_.
|
> 1. Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
|
||||||
> 1. Let _expansionKeys_ be the list of keys of _matchObj_ either ending in
|
> single _"*"_, sorted by the sorting function **PATTERN_KEY_COMPARE** which
|
||||||
> _"/"_ or containing only a single _"*"_, sorted by the sorting function
|
> orders in descending order of specificity.
|
||||||
> **PATTERN_KEY_COMPARE** which orders in descending order of specificity.
|
|
||||||
> 1. For each key _expansionKey_ in _expansionKeys_, do
|
> 1. For each key _expansionKey_ in _expansionKeys_, do
|
||||||
> 1. Let _patternBase_ be **null**.
|
> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding
|
||||||
> 1. If _expansionKey_ contains _"*"_, set _patternBase_ to the substring of
|
> the first _"*"_ character.
|
||||||
> _expansionKey_ up to but excluding the first _"*"_ character.
|
> 1. If _matchKey_ starts with but is not equal to _patternBase_, then
|
||||||
> 1. If _patternBase_ is not **null** and _matchKey_ starts with but is not
|
|
||||||
> equal to _patternBase_, then
|
|
||||||
> 1. If _matchKey_ ends with _"/"_, throw an _Invalid Module Specifier_
|
|
||||||
> error.
|
|
||||||
> 1. Let _patternTrailer_ be the substring of _expansionKey_ from the
|
> 1. Let _patternTrailer_ be the substring of _expansionKey_ from the
|
||||||
> index after the first _"*"_ character.
|
> index after the first _"*"_ character.
|
||||||
> 1. If _patternTrailer_ has zero length, or if _matchKey_ ends with
|
> 1. If _patternTrailer_ has zero length, or if _matchKey_ ends with
|
||||||
@@ -1218,20 +1209,9 @@ _isImports_, _conditions_)
|
|||||||
> 1. Let _subpath_ be the substring of _matchKey_ starting at the
|
> 1. Let _subpath_ be the substring of _matchKey_ starting at the
|
||||||
> index of the length of _patternBase_ up to the length of
|
> index of the length of _patternBase_ up to the length of
|
||||||
> _matchKey_ minus the length of _patternTrailer_.
|
> _matchKey_ minus the length of _patternTrailer_.
|
||||||
> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**(
|
> 1. Return the result of **PACKAGE_TARGET_RESOLVE**(_packageURL_,
|
||||||
> _packageURL_, _target_, _subpath_, **true**, _isImports_,
|
> _target_, _subpath_, **true**, _isImports_, _conditions_).
|
||||||
> _conditions_).
|
> 1. Return **null**.
|
||||||
> 1. Return the object _{ resolved, exact: **true** }_.
|
|
||||||
> 1. Otherwise if _patternBase_ is **null** and _matchKey_ starts with
|
|
||||||
> _expansionKey_, then
|
|
||||||
> 1. Let _target_ be the value of _matchObj_\[_expansionKey_\].
|
|
||||||
> 1. Let _subpath_ be the substring of _matchKey_ starting at the
|
|
||||||
> index of the length of _expansionKey_.
|
|
||||||
> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**(
|
|
||||||
> _packageURL_, _target_, _subpath_, **false**, _isImports_,
|
|
||||||
> _conditions_).
|
|
||||||
> 1. Return the object _{ resolved, exact: **false** }_.
|
|
||||||
> 1. Return the object _{ resolved: **null**, exact: **true** }_.
|
|
||||||
|
|
||||||
**PATTERN_KEY_COMPARE**(_keyA_, _keyB_)
|
**PATTERN_KEY_COMPARE**(_keyA_, _keyB_)
|
||||||
|
|
||||||
|
|||||||
@@ -422,50 +422,6 @@ import featureX from 'es-module-package/features/x';
|
|||||||
// Loads ./node_modules/es-module-package/src/features/x.js
|
// Loads ./node_modules/es-module-package/src/features/x.js
|
||||||
```
|
```
|
||||||
|
|
||||||
### Subpath folder mappings
|
|
||||||
<!-- YAML
|
|
||||||
changes:
|
|
||||||
- version: v16.0.0
|
|
||||||
pr-url: https://github.com/nodejs/node/pull/37215
|
|
||||||
description: Runtime deprecation.
|
|
||||||
- version: v15.1.0
|
|
||||||
pr-url: https://github.com/nodejs/node/pull/35747
|
|
||||||
description: Runtime deprecation for self-referencing imports.
|
|
||||||
- version:
|
|
||||||
- v14.13.0
|
|
||||||
- v12.20.0
|
|
||||||
pr-url: https://github.com/nodejs/node/pull/34718
|
|
||||||
description: Documentation-only deprecation.
|
|
||||||
-->
|
|
||||||
|
|
||||||
> Stability: 0 - Deprecated: Use subpath patterns instead.
|
|
||||||
|
|
||||||
Before subpath patterns were supported, a trailing `"/"` suffix was used to
|
|
||||||
support folder mappings:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"exports": {
|
|
||||||
"./features/": "./features/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
_This feature will be removed in a future release._
|
|
||||||
|
|
||||||
Instead, use direct [subpath patterns][]:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"exports": {
|
|
||||||
"./features/*": "./features/*.js"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The benefit of patterns over folder exports is that packages can always be
|
|
||||||
imported by consumers without subpath file extensions being necessary.
|
|
||||||
|
|
||||||
### Exports sugar
|
### Exports sugar
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v12.11.0
|
added: v12.11.0
|
||||||
@@ -1270,7 +1226,6 @@ This field defines [subpath imports][] for the current package.
|
|||||||
[self-reference]: #self-referencing-a-package-using-its-name
|
[self-reference]: #self-referencing-a-package-using-its-name
|
||||||
[subpath exports]: #subpath-exports
|
[subpath exports]: #subpath-exports
|
||||||
[subpath imports]: #subpath-imports
|
[subpath imports]: #subpath-imports
|
||||||
[subpath patterns]: #subpath-patterns
|
|
||||||
[supported package managers]: corepack.md#supported-package-managers
|
[supported package managers]: corepack.md#supported-package-managers
|
||||||
[the dual CommonJS/ES module packages section]: #dual-commonjses-module-packages
|
[the dual CommonJS/ES module packages section]: #dual-commonjses-module-packages
|
||||||
[the full specifier path]: esm.md#mandatory-file-extensions
|
[the full specifier path]: esm.md#mandatory-file-extensions
|
||||||
@@ -457,7 +457,7 @@ function trySelf(parentPath, request) {
|
|||||||
try {
|
try {
|
||||||
return finalizeEsmResolution(packageExportsResolve(
|
return finalizeEsmResolution(packageExportsResolve(
|
||||||
pathToFileURL(pkgPath + '/package.json'), expansion, pkg,
|
pathToFileURL(pkgPath + '/package.json'), expansion, pkg,
|
||||||
pathToFileURL(parentPath), cjsConditions), request, parentPath, pkgPath);
|
pathToFileURL(parentPath), cjsConditions), parentPath, pkgPath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
||||||
throw createEsmNotFoundErr(request, pkgPath + '/package.json');
|
throw createEsmNotFoundErr(request, pkgPath + '/package.json');
|
||||||
@@ -481,7 +481,7 @@ function resolveExports(nmPath, request) {
|
|||||||
try {
|
try {
|
||||||
return finalizeEsmResolution(packageExportsResolve(
|
return finalizeEsmResolution(packageExportsResolve(
|
||||||
pathToFileURL(pkgPath + '/package.json'), '.' + expansion, pkg, null,
|
pathToFileURL(pkgPath + '/package.json'), '.' + expansion, pkg, null,
|
||||||
cjsConditions), request, null, pkgPath);
|
cjsConditions), null, pkgPath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
||||||
throw createEsmNotFoundErr(request, pkgPath + '/package.json');
|
throw createEsmNotFoundErr(request, pkgPath + '/package.json');
|
||||||
@@ -894,7 +894,7 @@ Module._resolveFilename = function(request, parent, isMain, options) {
|
|||||||
try {
|
try {
|
||||||
return finalizeEsmResolution(
|
return finalizeEsmResolution(
|
||||||
packageImportsResolve(request, pathToFileURL(parent.filename),
|
packageImportsResolve(request, pathToFileURL(parent.filename),
|
||||||
cjsConditions), request, parent.filename,
|
cjsConditions), parent.filename,
|
||||||
pkg.path);
|
pkg.path);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
||||||
@@ -936,18 +936,12 @@ Module._resolveFilename = function(request, parent, isMain, options) {
|
|||||||
throw err;
|
throw err;
|
||||||
};
|
};
|
||||||
|
|
||||||
function finalizeEsmResolution(match, request, parentPath, pkgPath) {
|
function finalizeEsmResolution(resolved, parentPath, pkgPath) {
|
||||||
const { resolved, exact } = match;
|
|
||||||
if (RegExpPrototypeTest(encodedSepRegEx, resolved))
|
if (RegExpPrototypeTest(encodedSepRegEx, resolved))
|
||||||
throw new ERR_INVALID_MODULE_SPECIFIER(
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
||||||
resolved, 'must not include encoded "/" or "\\" characters', parentPath);
|
resolved, 'must not include encoded "/" or "\\" characters', parentPath);
|
||||||
const filename = fileURLToPath(resolved);
|
const filename = fileURLToPath(resolved);
|
||||||
let actual = tryFile(filename);
|
const actual = tryFile(filename);
|
||||||
if (!exact && !actual) {
|
|
||||||
const exts = ObjectKeys(Module._extensions);
|
|
||||||
actual = tryExtensions(filename, exts, false) ||
|
|
||||||
tryPackage(filename, exts, false, request);
|
|
||||||
}
|
|
||||||
if (actual)
|
if (actual)
|
||||||
return actual;
|
return actual;
|
||||||
const err = createEsmNotFoundErr(filename,
|
const err = createEsmNotFoundErr(filename,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const {
|
|||||||
StringPrototypeIncludes,
|
StringPrototypeIncludes,
|
||||||
StringPrototypeIndexOf,
|
StringPrototypeIndexOf,
|
||||||
StringPrototypeLastIndexOf,
|
StringPrototypeLastIndexOf,
|
||||||
|
StringPrototypeReplace,
|
||||||
StringPrototypeSlice,
|
StringPrototypeSlice,
|
||||||
StringPrototypeSplit,
|
StringPrototypeSplit,
|
||||||
StringPrototypeStartsWith,
|
StringPrototypeStartsWith,
|
||||||
@@ -82,38 +83,15 @@ const DEFAULT_CONDITIONS_SET = new SafeSet(DEFAULT_CONDITIONS);
|
|||||||
|
|
||||||
const emittedPackageWarnings = new SafeSet();
|
const emittedPackageWarnings = new SafeSet();
|
||||||
|
|
||||||
/**
|
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
||||||
* @param {string} match
|
|
||||||
* @param {URL} pjsonUrl
|
|
||||||
* @param {boolean} isExports
|
|
||||||
* @param {string | URL | undefined} base
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
|
|
||||||
const pjsonPath = fileURLToPath(pjsonUrl);
|
|
||||||
|
|
||||||
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
|
|
||||||
return;
|
|
||||||
emittedPackageWarnings.add(pjsonPath + '|' + match);
|
|
||||||
process.emitWarning(
|
|
||||||
`Use of deprecated folder mapping "${match}" in the ${isExports ?
|
|
||||||
'"exports"' : '"imports"'} field module resolution of the package at ${
|
|
||||||
pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ''}.\n` +
|
|
||||||
`Update this package.json to use a subpath pattern like "${match}*".`,
|
|
||||||
'DeprecationWarning',
|
|
||||||
'DEP0148'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) {
|
|
||||||
const pjsonPath = fileURLToPath(pjsonUrl);
|
const pjsonPath = fileURLToPath(pjsonUrl);
|
||||||
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
|
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
|
||||||
return;
|
return;
|
||||||
emittedPackageWarnings.add(pjsonPath + '|' + match);
|
emittedPackageWarnings.add(pjsonPath + '|' + match);
|
||||||
process.emitWarning(
|
process.emitWarning(
|
||||||
`Use of deprecated trailing slash pattern mapping "${match}" in the ${
|
`Use of deprecated trailing slash pattern mapping "${match}" in the ` +
|
||||||
isExports ? '"exports"' : '"imports"'} field module resolution of the ` +
|
`"exports" field module resolution of the package at ${pjsonPath}${
|
||||||
`package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` :
|
base ? ` imported from ${fileURLToPath(base)}` :
|
||||||
''}. Mapping specifiers ending in "/" is no longer supported.`,
|
''}. Mapping specifiers ending in "/" is no longer supported.`,
|
||||||
'DeprecationWarning',
|
'DeprecationWarning',
|
||||||
'DEP0155'
|
'DEP0155'
|
||||||
@@ -504,8 +482,11 @@ function resolvePackageTargetString(
|
|||||||
|
|
||||||
if (subpath === '') return resolved;
|
if (subpath === '') return resolved;
|
||||||
|
|
||||||
if (RegExpPrototypeTest(invalidSegmentRegEx, subpath))
|
if (RegExpPrototypeTest(invalidSegmentRegEx, subpath)) {
|
||||||
throwInvalidSubpath(match + subpath, packageJSONUrl, internal, base);
|
const request = pattern ?
|
||||||
|
StringPrototypeReplace(match, '*', () => subpath) : match + subpath;
|
||||||
|
throwInvalidSubpath(request, packageJSONUrl, internal, base);
|
||||||
|
}
|
||||||
|
|
||||||
if (pattern)
|
if (pattern)
|
||||||
return new URL(RegExpPrototypeSymbolReplace(patternRegEx, resolved.href,
|
return new URL(RegExpPrototypeSymbolReplace(patternRegEx, resolved.href,
|
||||||
@@ -641,7 +622,7 @@ function packageExportsResolve(
|
|||||||
);
|
);
|
||||||
if (resolved === null || resolved === undefined)
|
if (resolved === null || resolved === undefined)
|
||||||
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
||||||
return { resolved, exact: true };
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
let bestMatch = '';
|
let bestMatch = '';
|
||||||
@@ -653,9 +634,15 @@ function packageExportsResolve(
|
|||||||
if (patternIndex !== -1 &&
|
if (patternIndex !== -1 &&
|
||||||
StringPrototypeStartsWith(packageSubpath,
|
StringPrototypeStartsWith(packageSubpath,
|
||||||
StringPrototypeSlice(key, 0, patternIndex))) {
|
StringPrototypeSlice(key, 0, patternIndex))) {
|
||||||
|
// When this reaches EOL, this can throw at the top of the whole function:
|
||||||
|
//
|
||||||
|
// if (StringPrototypeEndsWith(packageSubpath, '/'))
|
||||||
|
// throwInvalidSubpath(packageSubpath)
|
||||||
|
//
|
||||||
|
// To match "imports" and the spec.
|
||||||
if (StringPrototypeEndsWith(packageSubpath, '/'))
|
if (StringPrototypeEndsWith(packageSubpath, '/'))
|
||||||
emitTrailingSlashPatternDeprecation(packageSubpath, packageJSONUrl,
|
emitTrailingSlashPatternDeprecation(packageSubpath, packageJSONUrl,
|
||||||
true, base);
|
base);
|
||||||
const patternTrailer = StringPrototypeSlice(key, patternIndex + 1);
|
const patternTrailer = StringPrototypeSlice(key, patternIndex + 1);
|
||||||
if (packageSubpath.length >= key.length &&
|
if (packageSubpath.length >= key.length &&
|
||||||
StringPrototypeEndsWith(packageSubpath, patternTrailer) &&
|
StringPrototypeEndsWith(packageSubpath, patternTrailer) &&
|
||||||
@@ -666,25 +653,17 @@ function packageExportsResolve(
|
|||||||
packageSubpath, patternIndex,
|
packageSubpath, patternIndex,
|
||||||
packageSubpath.length - patternTrailer.length);
|
packageSubpath.length - patternTrailer.length);
|
||||||
}
|
}
|
||||||
} else if (key[key.length - 1] === '/' &&
|
|
||||||
StringPrototypeStartsWith(packageSubpath, key) &&
|
|
||||||
patternKeyCompare(bestMatch, key) === 1) {
|
|
||||||
bestMatch = key;
|
|
||||||
bestMatchSubpath = StringPrototypeSlice(packageSubpath, key.length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bestMatch) {
|
if (bestMatch) {
|
||||||
const target = exports[bestMatch];
|
const target = exports[bestMatch];
|
||||||
const pattern = StringPrototypeIncludes(bestMatch, '*');
|
|
||||||
const resolved = resolvePackageTarget(packageJSONUrl, target,
|
const resolved = resolvePackageTarget(packageJSONUrl, target,
|
||||||
bestMatchSubpath, bestMatch, base,
|
bestMatchSubpath, bestMatch, base,
|
||||||
pattern, false, conditions);
|
true, false, conditions);
|
||||||
if (resolved === null || resolved === undefined)
|
if (resolved === null || resolved === undefined)
|
||||||
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
||||||
if (!pattern)
|
return resolved;
|
||||||
emitFolderMapDeprecation(bestMatch, packageJSONUrl, true, base);
|
|
||||||
return { resolved, exact: pattern };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
|
||||||
@@ -711,7 +690,8 @@ function patternKeyCompare(a, b) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function packageImportsResolve(name, base, conditions) {
|
function packageImportsResolve(name, base, conditions) {
|
||||||
if (name === '#' || StringPrototypeStartsWith(name, '#/')) {
|
if (name === '#' || StringPrototypeStartsWith(name, '#/') ||
|
||||||
|
StringPrototypeEndsWith(name, '/')) {
|
||||||
const reason = 'is not a valid internal imports specifier name';
|
const reason = 'is not a valid internal imports specifier name';
|
||||||
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base));
|
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base));
|
||||||
}
|
}
|
||||||
@@ -722,13 +702,12 @@ function packageImportsResolve(name, base, conditions) {
|
|||||||
const imports = packageConfig.imports;
|
const imports = packageConfig.imports;
|
||||||
if (imports) {
|
if (imports) {
|
||||||
if (ObjectPrototypeHasOwnProperty(imports, name) &&
|
if (ObjectPrototypeHasOwnProperty(imports, name) &&
|
||||||
!StringPrototypeIncludes(name, '*') &&
|
!StringPrototypeIncludes(name, '*')) {
|
||||||
!StringPrototypeEndsWith(name, '/')) {
|
|
||||||
const resolved = resolvePackageTarget(
|
const resolved = resolvePackageTarget(
|
||||||
packageJSONUrl, imports[name], '', name, base, false, true, conditions
|
packageJSONUrl, imports[name], '', name, base, false, true, conditions
|
||||||
);
|
);
|
||||||
if (resolved !== null)
|
if (resolved !== null && resolved !== undefined)
|
||||||
return { resolved, exact: true };
|
return resolved;
|
||||||
} else {
|
} else {
|
||||||
let bestMatch = '';
|
let bestMatch = '';
|
||||||
let bestMatchSubpath;
|
let bestMatchSubpath;
|
||||||
@@ -749,26 +728,16 @@ function packageImportsResolve(name, base, conditions) {
|
|||||||
bestMatchSubpath = StringPrototypeSlice(
|
bestMatchSubpath = StringPrototypeSlice(
|
||||||
name, patternIndex, name.length - patternTrailer.length);
|
name, patternIndex, name.length - patternTrailer.length);
|
||||||
}
|
}
|
||||||
} else if (key[key.length - 1] === '/' &&
|
|
||||||
StringPrototypeStartsWith(name, key) &&
|
|
||||||
patternKeyCompare(bestMatch, key) === 1) {
|
|
||||||
bestMatch = key;
|
|
||||||
bestMatchSubpath = StringPrototypeSlice(name, key.length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bestMatch) {
|
if (bestMatch) {
|
||||||
const target = imports[bestMatch];
|
const target = imports[bestMatch];
|
||||||
const pattern = StringPrototypeIncludes(bestMatch, '*');
|
|
||||||
const resolved = resolvePackageTarget(packageJSONUrl, target,
|
const resolved = resolvePackageTarget(packageJSONUrl, target,
|
||||||
bestMatchSubpath, bestMatch,
|
bestMatchSubpath, bestMatch,
|
||||||
base, pattern, true,
|
base, true, true, conditions);
|
||||||
conditions);
|
if (resolved !== null && resolved !== undefined)
|
||||||
if (resolved !== null) {
|
return resolved;
|
||||||
if (!pattern)
|
|
||||||
emitFolderMapDeprecation(bestMatch, packageJSONUrl, false, base);
|
|
||||||
return { resolved, exact: pattern };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -845,7 +814,7 @@ function packageResolve(specifier, base, conditions) {
|
|||||||
packageConfig.exports !== undefined && packageConfig.exports !== null) {
|
packageConfig.exports !== undefined && packageConfig.exports !== null) {
|
||||||
return packageExportsResolve(
|
return packageExportsResolve(
|
||||||
packageJSONUrl, packageSubpath, packageConfig, base, conditions
|
packageJSONUrl, packageSubpath, packageConfig, base, conditions
|
||||||
).resolved;
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,7 +839,7 @@ function packageResolve(specifier, base, conditions) {
|
|||||||
if (packageConfig.exports !== undefined && packageConfig.exports !== null)
|
if (packageConfig.exports !== undefined && packageConfig.exports !== null)
|
||||||
return packageExportsResolve(
|
return packageExportsResolve(
|
||||||
packageJSONUrl, packageSubpath, packageConfig, base, conditions
|
packageJSONUrl, packageSubpath, packageConfig, base, conditions
|
||||||
).resolved;
|
);
|
||||||
if (packageSubpath === '.')
|
if (packageSubpath === '.')
|
||||||
return legacyMainResolve(packageJSONUrl, packageConfig, base);
|
return legacyMainResolve(packageJSONUrl, packageConfig, base);
|
||||||
return new URL(packageSubpath, packageJSONUrl);
|
return new URL(packageSubpath, packageJSONUrl);
|
||||||
@@ -919,7 +888,7 @@ function moduleResolve(specifier, base, conditions) {
|
|||||||
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
||||||
resolved = new URL(specifier, base);
|
resolved = new URL(specifier, base);
|
||||||
} else if (specifier[0] === '#') {
|
} else if (specifier[0] === '#') {
|
||||||
({ resolved } = packageImportsResolve(specifier, base, conditions));
|
resolved = packageImportsResolve(specifier, base, conditions);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
resolved = new URL(specifier);
|
resolved = new URL(specifier);
|
||||||
|
|||||||
@@ -3,12 +3,7 @@ import assert from 'assert';
|
|||||||
|
|
||||||
let curWarning = 0;
|
let curWarning = 0;
|
||||||
const expectedWarnings = [
|
const expectedWarnings = [
|
||||||
'"./sub/"',
|
|
||||||
'"./fallbackdir/"',
|
|
||||||
'"./trailing-pattern-slash/"',
|
'"./trailing-pattern-slash/"',
|
||||||
'"./subpath/"',
|
|
||||||
'"./subpath/dir1/"',
|
|
||||||
'"./subpath/dir2/"',
|
|
||||||
'no_exports',
|
'no_exports',
|
||||||
'default_index',
|
'default_index',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js';
|
|||||||
const validSpecifiers = new Map([
|
const validSpecifiers = new Map([
|
||||||
// A simple mapping of a path.
|
// A simple mapping of a path.
|
||||||
['pkgexports/valid-cjs', { default: 'asdf' }],
|
['pkgexports/valid-cjs', { default: 'asdf' }],
|
||||||
// A directory mapping, pointing to the package root.
|
|
||||||
['pkgexports/sub/asdf.js', { default: 'asdf' }],
|
|
||||||
// A mapping pointing to a file that needs special encoding (%20) in URLs.
|
// A mapping pointing to a file that needs special encoding (%20) in URLs.
|
||||||
['pkgexports/space', { default: 'encoded path' }],
|
['pkgexports/space', { default: 'encoded path' }],
|
||||||
// Verifying that normal packages still work with exports turned on.
|
// Verifying that normal packages still work with exports turned on.
|
||||||
@@ -47,15 +45,7 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js';
|
|||||||
{ default: 'trailing-pattern-slash' }],
|
{ default: 'trailing-pattern-slash' }],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (isRequire) {
|
if (!isRequire) {
|
||||||
validSpecifiers.set('pkgexports/subpath/file', { default: 'file' });
|
|
||||||
validSpecifiers.set('pkgexports/subpath/dir1', { default: 'main' });
|
|
||||||
// Deprecated:
|
|
||||||
validSpecifiers.set('pkgexports/subpath/dir1/', { default: 'main' });
|
|
||||||
validSpecifiers.set('pkgexports/subpath/dir2', { default: 'index' });
|
|
||||||
// Deprecated:
|
|
||||||
validSpecifiers.set('pkgexports/subpath/dir2/', { default: 'index' });
|
|
||||||
} else {
|
|
||||||
// No exports or main field
|
// No exports or main field
|
||||||
validSpecifiers.set('no_exports', { default: 'index' });
|
validSpecifiers.set('no_exports', { default: 'index' });
|
||||||
// Main field without extension
|
// Main field without extension
|
||||||
@@ -93,8 +83,6 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js';
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const invalidExports = new Map([
|
const invalidExports = new Map([
|
||||||
// Directory mappings require a trailing / to work
|
|
||||||
['pkgexports/missingtrailer/x', './missingtrailer/'],
|
|
||||||
// This path steps back inside the package but goes through an exports
|
// This path steps back inside the package but goes through an exports
|
||||||
// target that escapes the package, so we still catch that as invalid
|
// target that escapes the package, so we still catch that as invalid
|
||||||
['pkgexports/belowdir/pkgexports/asdf.js', './belowdir/'],
|
['pkgexports/belowdir/pkgexports/asdf.js', './belowdir/'],
|
||||||
@@ -171,7 +159,6 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js';
|
|||||||
strictEqual(err.code, 'ERR_UNSUPPORTED_DIR_IMPORT');
|
strictEqual(err.code, 'ERR_UNSUPPORTED_DIR_IMPORT');
|
||||||
assertStartsWith(err.message, 'Directory import');
|
assertStartsWith(err.message, 'Directory import');
|
||||||
};
|
};
|
||||||
notFoundExports.set('pkgexports/subpath/file', 'pkgexports/subpath/file');
|
|
||||||
loadFixture('pkgexports/subpath/dir1').catch(mustCall(onDirectoryImport));
|
loadFixture('pkgexports/subpath/dir1').catch(mustCall(onDirectoryImport));
|
||||||
loadFixture('pkgexports/subpath/dir2').catch(mustCall(onDirectoryImport));
|
loadFixture('pkgexports/subpath/dir2').catch(mustCall(onDirectoryImport));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ const { requireImport, importImport } = importer;
|
|||||||
}
|
}
|
||||||
|
|
||||||
const invalidImportTargets = new Set([
|
const invalidImportTargets = new Set([
|
||||||
// External subpath import without trailing slash
|
|
||||||
['#external/invalidsubpath/x', '#external/invalidsubpath/'],
|
|
||||||
// Target steps below the package base
|
// Target steps below the package base
|
||||||
['#belowbase', '#belowbase'],
|
['#belowbase', '#belowbase'],
|
||||||
// Target is a URL
|
// Target is a URL
|
||||||
@@ -73,6 +71,8 @@ const { requireImport, importImport } = importer;
|
|||||||
}
|
}
|
||||||
|
|
||||||
const undefinedImports = new Set([
|
const undefinedImports = new Set([
|
||||||
|
// EOL subpaths
|
||||||
|
'#external/invalidsubpath/x',
|
||||||
// Missing import
|
// Missing import
|
||||||
'#missing',
|
'#missing',
|
||||||
// Explicit null import
|
// Explicit null import
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
import '../common/index.mjs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import fixtures from '../common/fixtures.js';
|
|
||||||
import { pathToFileURL } from 'url';
|
|
||||||
|
|
||||||
const selfDeprecatedFolders =
|
|
||||||
fixtures.path('/es-modules/self-deprecated-folders/main.js');
|
|
||||||
|
|
||||||
const deprecatedFoldersIgnore =
|
|
||||||
fixtures.path('/es-modules/deprecated-folders-ignore/main.js');
|
|
||||||
|
|
||||||
const deprecatedTrailingSlashPattern =
|
|
||||||
fixtures.path('/es-modules/pattern-trailing-slash.mjs');
|
|
||||||
|
|
||||||
const expectedWarnings = [
|
|
||||||
'"./" in the "exports" field',
|
|
||||||
'"#self/" in the "imports" field',
|
|
||||||
'"./folder/" in the "exports" field',
|
|
||||||
'"./trailing-pattern-slash/" in the "exports" field',
|
|
||||||
];
|
|
||||||
|
|
||||||
process.addListener('warning', (warning) => {
|
|
||||||
if (warning.stack.includes(expectedWarnings[0])) {
|
|
||||||
expectedWarnings.shift();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on('exit', () => {
|
|
||||||
assert.deepStrictEqual(expectedWarnings, []);
|
|
||||||
});
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
await import(pathToFileURL(selfDeprecatedFolders));
|
|
||||||
await import(pathToFileURL(deprecatedFoldersIgnore));
|
|
||||||
await import(pathToFileURL(deprecatedTrailingSlashPattern));
|
|
||||||
})()
|
|
||||||
.catch((err) => console.error(err));
|
|
||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
},
|
},
|
||||||
"default": "./test.js"
|
"default": "./test.js"
|
||||||
},
|
},
|
||||||
"#subpath/nullshadow/": [null],
|
"#subpath/nullshadow/*": [null],
|
||||||
"#": "./test.js",
|
"#": "./test.js",
|
||||||
"#/initialslash": "./test.js",
|
"#/initialslash": "./test.js",
|
||||||
"#notfound": "./notfound.js",
|
"#notfound": "./notfound.js",
|
||||||
|
|||||||
+4
-5
@@ -4,10 +4,9 @@
|
|||||||
"./hole": "./lib/hole.js",
|
"./hole": "./lib/hole.js",
|
||||||
"./space": "./sp%20ce.js",
|
"./space": "./sp%20ce.js",
|
||||||
"./valid-cjs": "./asdf.js",
|
"./valid-cjs": "./asdf.js",
|
||||||
"./sub/": "./",
|
"./sub/*": "./*",
|
||||||
"./belowdir/": "../belowdir/",
|
"./belowdir/*": "../belowdir/*",
|
||||||
"./belowfile": "../belowfile",
|
"./belowfile": "../belowfile",
|
||||||
"./missingtrailer/": ".",
|
|
||||||
"./null": null,
|
"./null": null,
|
||||||
"./null/": null,
|
"./null/": null,
|
||||||
"./invalid1": {},
|
"./invalid1": {},
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
"./invalid3": "",
|
"./invalid3": "",
|
||||||
"./invalid4": {},
|
"./invalid4": {},
|
||||||
"./invalid5": "invalid5.js",
|
"./invalid5": "invalid5.js",
|
||||||
"./fallbackdir/": [[], null, {}, "builtin:x/", "./fallbackfile", "./"],
|
"./fallbackdir/*": [[], null, {}, "builtin:x/*", "./*"],
|
||||||
"./fallbackfile": [[], null, {}, "builtin:x", "./asdf.js"],
|
"./fallbackfile": [[], null, {}, "builtin:x", "./asdf.js"],
|
||||||
"./nofallback1": [],
|
"./nofallback1": [],
|
||||||
"./nofallback2": [null, {}, "builtin:x"],
|
"./nofallback2": [null, {}, "builtin:x"],
|
||||||
@@ -58,7 +57,7 @@
|
|||||||
"./a/*": "./subpath/*.js",
|
"./a/*": "./subpath/*.js",
|
||||||
"./a/b/": "./nomatch/",
|
"./a/b/": "./nomatch/",
|
||||||
"./a/b*": "./subpath*.js",
|
"./a/b*": "./subpath*.js",
|
||||||
"./subpath/": "./subpath/",
|
"./subpath/*": "./subpath/*",
|
||||||
"./subpath/sub-*": "./subpath/dir1/*.js",
|
"./subpath/sub-*": "./subpath/dir1/*.js",
|
||||||
"./subpath/sub-*.js": "./subpath/dir1/*.js",
|
"./subpath/sub-*.js": "./subpath/dir1/*.js",
|
||||||
"./features/*": "./subpath/*/*.js",
|
"./features/*": "./subpath/*/*.js",
|
||||||
|
|||||||
Reference in new issue
Block a user