From 36e2ffe6dc379043be96ebfd889ccd1a3e38aa84 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 15 Sep 2021 02:52:40 -0700 Subject: module: subpath folder mappings EOL PR-URL: https://github.com/nodejs/node/pull/40121 Reviewed-By: Geoffrey Booth Reviewed-By: Bradley Farias Reviewed-By: Myles Borins Reviewed-By: Matteo Collina --- doc/api/deprecations.md | 10 +++--- doc/api/esm.md | 82 +++++++++++++++++++------------------------------ doc/api/packages.md | 45 --------------------------- 3 files changed, 37 insertions(+), 100 deletions(-) (limited to 'doc/api') diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 593413efc01..fabf91eef56 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2707,6 +2707,9 @@ Use `fs.rm(path, { recursive: true, force: true })`, ### DEP0148: Folder mappings in `"exports"` (trailing `"/"`) - -> 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