flowbite-react
flowbite-react copied to clipboard
perf(component treeshaking): updated config and build files to treesh…
Each component can now OPTIONALLY be imported individually from the components path.
EXAMPLE:
import { Badge } from "flowbite-react/components/Badge";
function App() {
return (
<div className="w-10/12">
<Badge>Test</Badge>
</div>
);
}
Components with old pattern:
import { Badge } from "flowbite-react";
function App() {
return (
<div className="w-10/12">
<Badge>Test</Badge>
</div>
);
}
Will still work, but will still treeshake hell as well.
PS: This pr will not fix the themes treeshaking which seems to be more complex.
#1197
Keen to hear back from the maintainers.
FINAL BUILD RESULT with "/components":
FINAL BUILD RESULT w/out "/components":