timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.73k stars 323 forks source link

build: switch bundler to bunchee #337

Open huozhi opened 8 months ago

huozhi commented 8 months ago

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)
vercel[bot] commented 8 months ago

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
vercel[bot] commented 8 months ago

@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.