Skip to content

Commit 0c0bb58

Browse files
Update doc/api/packages.md
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent b9112f1 commit 0c0bb58

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

doc/api/packages.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,11 @@ The `"private"` field marks a package as private, signaling to package managers
11811181
such as _npm_ that it must not be published to a public registry.
11821182
By default, Node.js refuses to strip types from TypeScript files inside
11831183
`node_modules`. When [`--experimental-strip-private-modules`][] is enabled,
1184-
Node.js allows type stripping for a file only if its `package.json`
1185-
sets `"private": true`.
1184+
Node.js allows type stripping for:
1185+
1186+
- files that are not descendant of a `node_modules` directory.
1187+
- files that are descendant of a directory whose parent is a `node_modules` directory
1188+
and that contains a `package.json` file that sets `"private": true`.
11861189

11871190
[CommonJS]: modules.md
11881191
[Conditional exports]: #conditional-exports

0 commit comments

Comments
 (0)