Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conditional export bundle mapping #553

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

huozhi
Copy link
Owner

@huozhi huozhi commented Jun 21, 2024

Problem

development condition is declared first, then it's always get picked

Fix

We should pass down the current condition names of entry to alias plugin, to let it decide which condition shall we alias.

  • If there's special condition matched in other exports, prefer those ones;
  • If there's no special condition matched, fallback to default if there's no other conditon (import/require) based on bundle type (cjs or esm);

Fixes #548

@huozhi huozhi merged commit 1374e47 into main Jun 21, 2024
4 checks passed
@huozhi huozhi deleted the fix/dev-prod-cond-mapping branch June 21, 2024 23:19
renovate bot referenced this pull request in GSTJ/react-native-magic-modal Jul 17, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [bunchee](https://togithub.com/huozhi/bunchee) | [`5.1.6` ->
`5.2.2`](https://renovatebot.com/diffs/npm/bunchee/5.1.6/5.2.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/bunchee/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/bunchee/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/bunchee/5.1.6/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/bunchee/5.1.6/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>huozhi/bunchee (bunchee)</summary>

### [`v5.2.2`](https://togithub.com/huozhi/bunchee/releases/tag/v5.2.2)

[Compare
Source](https://togithub.com/huozhi/bunchee/compare/v5.2.1...v5.2.2)

#### Fixes

- Perf: Update `@swc/core` by [@&#8203;kdy1](https://togithub.com/kdy1)
in
[https://github.com/huozhi/bunchee/pull/552](https://togithub.com/huozhi/bunchee/pull/552)
- Fix: conditional export bundle mapping by
[@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/553](https://togithub.com/huozhi/bunchee/pull/553)

#### Misc

- Update to ts 5.5 by [@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/554](https://togithub.com/huozhi/bunchee/pull/554)

**Full Changelog**:
huozhi/bunchee@v5.2.1...v5.2.2

### [`v5.2.1`](https://togithub.com/huozhi/bunchee/releases/tag/v5.2.1)

[Compare
Source](https://togithub.com/huozhi/bunchee/compare/v5.2.0...v5.2.1)

#### Patches

- fix: dev spinner by [@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/549](https://togithub.com/huozhi/bunchee/pull/549)
- Fix special cond alias by
[@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/550](https://togithub.com/huozhi/bunchee/pull/550)

**Full Changelog**:
huozhi/bunchee@v5.2.0...v5.2.1

### [`v5.2.0`](https://togithub.com/huozhi/bunchee/releases/tag/v5.2.0)

[Compare
Source](https://togithub.com/huozhi/bunchee/compare/v5.1.6...v5.2.0)

#### Feature

We improved the module path generation when there're multi-entries and
dependent on each others, which using relative paths that will benefit
module resolving speed. Also we introduced a spinner during build to
help large project to visually notice the build change

- feat: generate relative imports by
[@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/538](https://togithub.com/huozhi/bunchee/pull/538)
- feat: loading spinner by [@&#8203;huozhi](https://togithub.com/huozhi)
in
[https://github.com/huozhi/bunchee/pull/539](https://togithub.com/huozhi/bunchee/pull/539)

#### Patches

- fix: special shouldnt override default condition by
[@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/543](https://togithub.com/huozhi/bunchee/pull/543)
- Fix watch mode spinner by
[@&#8203;huozhi](https://togithub.com/huozhi) in
[https://github.com/huozhi/bunchee/pull/545](https://togithub.com/huozhi/bunchee/pull/545)

**Full Changelog**:
huozhi/bunchee@v5.1.6...v5.2.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/GSTJ/react-native-magic-modal).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Production build overriding development build
1 participant