ui icon indicating copy to clipboard operation
ui copied to clipboard

[CLI] : add src directory in tailwind.config

Open kratos-respawned opened this issue 2 years ago • 4 comments

after using shadcn-ui init it should also add './src/**/*.{ts,tsx}' path in tailwind.config.js for src directory

 content: [
    "./pages/**/*.{ts,tsx}",
    "./components/**/*.{ts,tsx}",
    "./app/**/*.{ts,tsx}",
    "./src/**/*.{ts,tsx}",
  ],

kratos-respawned avatar May 03 '23 18:05 kratos-respawned

I've created a pull request

kratos-respawned avatar May 03 '23 18:05 kratos-respawned

I've encountered the same problem as my next project was originally initialized with a src dir. Not sure if specifically limiting the scope of tailwind parser to pages/app/components folder has any advantage or your fix ./src/**/* would work just fine, since all three are contained within src.

ttax00 avatar May 04 '23 09:05 ttax00

Maybe you can choose not include all these folders in the src folder all together when initializing a Next project from scratch with shadcn

monstajoe2002 avatar Jun 11 '23 15:06 monstajoe2002

That's a good point. However the original next.js app CLI provides an option to include src during initialization. And simply re-initialize a project to add shadcn UI library as a dependency might not be an option for some people.

Granted this is an easy fix, but it is confusing when the shad CLI doesn't support next options.

ttax00 avatar Jun 14 '23 18:06 ttax00

I believe this is fixed in the latest cli. Marking this as done. Feel free to reopen if not.

shadcn avatar Dec 22 '23 04:12 shadcn