You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
creating the production bundle with vitejs and inspecting the resulting bundle, I see the dist/lib/default-config.mjs file bundled, not the tailwind-merge.cjs.production.min.js one
Environment
tailwind-merge version: 1.14.0
Additional context
I don't know if this is intended , but inspecting the bundle I would think the compressed and minified tailwind-merge.cjs.production.min.js file would be used instead of the other one.
The text was updated successfully, but these errors were encountered:
This is intended. The tailwind-merge.cjs.production.min.js is for Node.js projects that use CommonJS and don't bundle and minify their code. When you use Vite, the ESM version of the library code gets loaded (which is not minified) as this is the standard for browsers. I kept the ESM version unminified to get better error reporting in dev-mode (where code stays unminified) if something goes wrong and because frontend bundlers, including Vite, usually minify the code automatically when producing a production build, so the tailwind-merge code gets minified anyway.
By the way, I'll remove the minified tailwind-merge.cjs.production.min.js file in an upcoming v2 release. You can read about the reasons for that here: #283 (comment)
PS: Thanks for your patience, I'm just coming back from a vacation.
Describe the bug
creating the production bundle with vitejs and inspecting the resulting bundle, I see the
dist/lib/default-config.mjs
file bundled, not thetailwind-merge.cjs.production.min.js
oneEnvironment
Additional context
I don't know if this is intended , but inspecting the bundle I would think the compressed and minified
tailwind-merge.cjs.production.min.js
file would be used instead of the other one.The text was updated successfully, but these errors were encountered: