timolins / react-hot-toast

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

Minify css template literals in production build #217

Open timolins opened 2 years ago

timolins commented 2 years ago

Problem

Most of the css is written within template literals, which is not minified in the build step at the moment. This adds a lot of unnecessary whitespace and bytes, which can be reduced by improving minification at build time.

Screenshot of sub-optimal built output:

Screenshot of unminified parts in source

Goals

Research

react-hot-toast is using tsup for building, which uses esbuild internally .

Resources I found while experimenting, with little success:

Any help would be appreciated

farishan commented 1 year ago

tsup new url: https://tsup.egoist.dev/