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: Default condition should be last one #173

Merged
merged 2 commits into from
Jun 5, 2024
Merged

Conversation

Janpot
Copy link
Contributor

@Janpot Janpot commented Jun 4, 2024

From the docs

  • "default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last.

This is failing our build

Can't immediately find it back, but I've seen it recommended to make types the first condition.

Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 3:09pm
react-runner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 3:09pm
react-runner-codemirror ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 3:09pm

"require": "./dist/index.js",
"default": "./dist/index.modern.js",
"types": "./dist/index.d.ts"
"default": "./dist/index.modern.js"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change it to

import:
require:
types:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this is desired, but as per microsoft/TypeScript#50762, tsc would resolve to the sibling declaration files before the types field condition 🤔

@nihgwu nihgwu changed the title Default condition should be last one fix: Default condition should be last one Jun 5, 2024
@nihgwu nihgwu self-assigned this Jun 5, 2024
@nihgwu nihgwu merged commit 2878890 into nihgwu:master Jun 5, 2024
5 checks passed
@nihgwu
Copy link
Owner

nihgwu commented Jun 5, 2024

Thanks, released react-runner@1.0.5

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.

2 participants