Commit 18a93cf
authored
feat(js): ignore scoped export conditions (#32063)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
There is an emerging pattern of using scoped custom export conditions
for pointing to source. See:
- [Announcing TypeScript
5.7](https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#path-rewriting-for-relative-paths:~:text=As%20a%20result%2C%20if%20you%E2%80%99ve%20been%20using%20a%20workspace%2Dstyle%20layout%20with%20multiple%20packages%20referencing%20each%20other%2C%20you%20might%20need%20to%20use%20conditional%20exports%20with%20scoped%20custom%20conditions%20to%20make%20this%20work%3A)
- [Live types in a TypeScript
monorepo](https://colinhacks.com/essays/live-types-typescript-monorepo#:~:text=Here%27s%20how%20a%20custom%20condition%20might%20look%20in%20your%20package.json.%20There%27s%20nothing%20special%20about%20the%20string%20%22%40colinhacks/zod%22%20here!%20It%20could%20be%20anything.)
- [Loading from
Source](https://github.com/isaacs/tshy?tab=readme-ov-file#loading-from-source)
## Current Behavior
<!-- This is the behavior we have today -->
When including an export condition that points to the source code the
typescript plugin does not add a build target. However, if this export
condition is named `development` the build target is added.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Scoped export conditions pointing at source should not remove the build
target.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->1 parent 23cc746 commit 18a93cf
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
199 | 204 | | |
| |||
0 commit comments