material-tailwind
material-tailwind copied to clipboard
Tree-shaking Material Taiwind
I tried building the project and used "rollup-plugin-visualizer" when building my Vite react project and I see that all the Material Tailwind Components are included in my production build bundle, even if I did not use all the components.
Is there any way to fix it?
is it a vite problem or material-tailwind problem? im using vite + material-tailwind in my project and i have the same issue, notice the tree shake is not working either, but it's the same case for flowbite, until i put an adjustment like this in the vite.config.
rollupOptions: {
treeshake: {
moduleSideEffects: (id) => {
return (
id.includes("flowbite-react")
|| id.includes("material-tailwind/react")
) ? false : null;
},
},
...