Files
angular/packages
arturovt a47f9c581d fix(zone.js): add types condition to subpath exports
Consider the following example:

```ts
if (ngDevMode) {
  await import('zone.js/plugins/task-tracking');
}
```

Under `moduleResolution: "bundler"`, `"node16"` or `"nodenext"` this fails to
type-check:

```
Could not find a declaration file for module 'zone.js/plugins/task-tracking'.
'.../node_modules/zone.js/fesm2015/task-tracking.js' implicitly has an 'any' type.
```

The `exports` map declares `types` only on the root entry, so every subpath
resolves to a bare `.js` file. Legacy `moduleResolution: "node"` ignores
`exports` and finds files by path, which is why nobody hit this until the
newer resolution modes became common.

Prior to this commit there was nothing a subpath `types` condition could
point at, because the package shipped a single declaration file at its root.
With this commit the build emits one declaration next to each bundle, and
every subpath gets a `types` condition. The bundles patch globals and export
nothing, so each declaration is `export {};` and adds no API surface to
maintain.

Legacy `node` resolution does not change. Those subpaths did not resolve
there before this commit either.

(cherry picked from commit d3a3ebf0a0)
2026-11-17 17:33:06 +00:00
..
2025-11-06 10:03:05 -08:00
…
…
2026-01-07 12:28:34 -05:00
2025-11-06 10:03:05 -08:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT