rails / cssbundling-rails

Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
MIT License
579 stars 83 forks source link

Tailwind Config is in the wrong place #77

Closed resistorsoftware closed 2 years ago

resistorsoftware commented 2 years ago

So the package.json is tricked out with a build:css command in the scripts. Awesome.

The build script we like, is tailwindcss which is the CLI, and accept input, and produces output.

"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css"

But here is the rub. That command requires tailwind.config.js, and that file is stored at config/tailwind.config.js

So now when the foreman job runs the Procfile.dev and then exectutes the build, the build complains, hey, I have no idea what you're doing, as it cannot find this crucial file.

If you place that file in the root of the App, it works fine. Is this somehow some kind of thing where I am missing something? Is this an error in the install, or is there a way to get Rails to build nicely in development and production, with the tailwind.config.js in the config/ directory?

Also, this gem mentions postcss. It installed postcss when I selected Tailwind. But it made no configuration file for postcss. Had this file been created, likely in the root, then yes, I could've visualized it being stocked with pointer to tailwind.config.js being in a strange place config/, but there is nothing like that going on.

It seems strange. All these necessary pieces just being thrown down, but then not wired up right?

resistorsoftware commented 2 years ago

Nevermind... it seems I left a reference to tailwindcss-rails in my project, and it was responsible for all the mayham.