Skip to content

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 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 11:49pm

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