Improve monorepo support, provide configuration path for `.flowbite-react` directory
- [x] I have searched the Issues to see if this bug has already been reported
- [x] I have tested the latest version
Steps to reproduce
- Create repository with Nx
- Use
@nx/vite - Run the application with
@nx/vite
Current behavior
The path of .flowbite-react by the plugin is being resolved into the root directory of the monorepo.
The class-list.json is being generated in the root directory.
Expected behavior
The path of .flowbite-react by the plugin is being resolved to the application directory or to the configured plugin path.
Context
When running scripts via NX the execution path is the root of the repository. This means when one does process.cwd() the root path is being returned.
I had similar issue with Tanstack Router, fortunately it has path configuration
defineViteConfig({
logLevel: 'info',
root: import.meta.dirname,
plugins: [
react(),
tailwindcss(),
flowbiteReact(),
svgr(),
TanStackRouterVite({
routesDirectory: `${import.meta.dirname}/src/routes`,
generatedRouteTree: `${import.meta.dirname}/src/routeTree.gen.ts`,
}),
],
U can solve this by simply running the npx flowbite-react@latest init into the target app directory u want to install it in.
What is ur project file structure?
U can solve this by simply running the npx flowbite-react@latest init into the target app directory u want to install it in.
I have already installed everything and have ran this script there. It did some things nice some things not so nice so had to manually move some bits and pieces around. But this is due to my custom setup.
What is ur project file structure?
> packages
>> some_package
> applications
>> web
>>> dashboard
>>>> src
>>>> viteconfig
>>>> .flowbite-react
I'll play around with nx monorepo setup and see what I can find.
Either the Flowbite plugin needs to be smart and be able to detect the actual path it should look for and create the config, or it can just accept variable with the path itself.
Don't think there is anything wrong with the second approach of giving path config as many projects have many different setups.
I'll try to make it automatic, with fallback to custom config passed through plugin options.