Closed richardfwashington closed 6 months ago
My project didn't even compile at all.
I managed to fix it by changing the following lines in my tailwind.config.ts
, based on the working project you linked to:
Change "./node_modules/flowbite-react/**/*.js"
to "./node_modules/flowbite-react/lib/**/*.js"
on the content
array.
Change
plugins: [
require("flowbite/plugin"),
],
to:
import flowbite from "flowbite/plugin";
...
plugins: [
flowbite,
],
I'm not sure which one fixed it.
The plugin changes you made I think are equivalent so that should not have made a difference. I prefer the import -> reference over require("whatever") but that is just a personal preference.
Your first change ...react/ -> ...react/lib/ will likely be the thing that allowed this to compile. It was taking SO long on my machine that it looked like it had failed.
I've created a PR for this change here -> https://github.com/themesberg/flowbite/pull/744 which fixes it.
I did afterward see another similar PR that scopes it further to the ...react/lib/esm/ folder however, I'm not sure this is necessary. Including the ...react/lib/cjs/ (aka everything in ...react/lib/**) folder is fine and makes no materially noticeable difference to the compile time.
The solution provided by @richardfwashington worked for me, too! Compliation time is reduced dramatically.
Fixed by @richardfwashington's PR. Thanks for contributing! <3
When following the guide here, running
npm run dev
results in a compilation time of ~90 seconds.Expected behavior Compilation should be <10 seconds.
Additional context This does not occur when following the guide at the bottom of the flowbite-next-start project here