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

build: switch bundler to bunchee #337

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

huozhi
Copy link

@huozhi huozhi commented Jan 21, 2024

What

Switch bundler to bunchee and refine the configurations in packages.json. This helps the types resolution become more compatible among node10, node16 composing with CJS/ESM resolutions. And you dont need to maintain a configuration anymore.

Also leave the asset by default without minification and without sourcemap. As framework will always minify the code for browser side. Regarding to sourcemap, I'm not sure how strong requirement the sourcemap will be, for instance if you want to users to see exact line from source code we can still provide it.

After

Using attw (are the types wrong CLI) testing locally

react-hot-toast v2.4.1

Build tools:
- typescript@^5.0.4

 No problems found 🌟


"react-hot-toast/package.json"

node10: 🟢 (JSON)
node16 (from CJS): 🟢 (JSON)
node16 (from ESM): 🟢 (JSON)
bundler: 🟢 (JSON)

***********************************

"react-hot-toast"

node10: 🟢
node16 (from CJS): 🟢 (CJS)
node16 (from ESM): 🟢 (ESM)
bundler: 🟢

***********************************

"react-hot-toast/headless"

node10: 🟢
node16 (from CJS): 🟢 (CJS)
node16 (from ESM): 🟢 (ESM)
bundler: 🟢

***********************************

Before

  "react-hot-toast/package.json" "react-hot-toast" "react-hot-toast/headless"
node10 ✅ (JSON) ❗️ Incorrect default export ❗️ Incorrect default export
node16 (from CJS) ✅ (JSON) ❗️ Incorrect default export ❗️ Incorrect default export
node16 (from ESM) ✅ (JSON) 🎭 Masquerading as CJS 🎭 Masquerading as CJS
bundler ✅ (JSON)

Copy link

vercel bot commented Jan 21, 2024

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

Name Status Preview Comments Updated (UTC)
react-hot-toast ❌ Failed (Inspect) Apr 1, 2024 3:41pm

Copy link

vercel bot commented Jan 28, 2024

@huozhi is attempting to deploy a commit to the analytics-billing-vtest314 Team on Vercel.

A member of the Team first needs to authorize it.

@huozhi huozhi marked this pull request as ready for review April 1, 2024 14:19
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