You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found case when Tailwindcss doesn't build overriden classes from node module on assets:precompile during deploy.
TL;DR:
If you have in your Gemfile tailwindcss-rails before jsbundling-rails tailwind will not scan project dependencies for styles in production environment during assets:precompile. If jsbundling-rails goes first it works well.
Possible solution:
This happen because they both enchasing assets:precompile task and tailwindcss-rails run tailwindcss:build before javascript dependencies will be installed by javascript:build and tailwind just have nothing to scan.
Maybe it could be solved by mounting tailwindcss:build to javascript:build if it defined?
# build.rake:
if Rake::Task.task_defined?("javascript:build")
Rake::Task["javascript:build"].enhance(["tailwindcss:build"])
else
Rake::Task["assets:precompile"].enhance(["tailwindcss:build"])
end
More details about my case:
In my app I use Tailwindcss-rails, jsbundling-rails, with esbuild and fullcalendar.
I wanted to override some classes and added to my application.tailwind.css somehting like this:
Overriden classes worked perfectly in dev environment, because I aways have node_modules installed at the moment of running tailwindcss:build. But in production (in my case staging) environment when I run assets:precompile tailwindcss generated all styles excepting related to fullcalendar.
The text was updated successfully, but these errors were encountered:
Napishite
changed the title
Tailwind ignores classes from node_modules
Tailwindcss ignores classes from node_modules
Dec 10, 2022
Hi!
I found case when Tailwindcss doesn't build overriden classes from node module on assets:precompile during deploy.
TL;DR:
If you have in your Gemfile tailwindcss-rails before jsbundling-rails tailwind will not scan project dependencies for styles in production environment during assets:precompile. If jsbundling-rails goes first it works well.
Possible solution:
This happen because they both enchasing assets:precompile task and tailwindcss-rails run tailwindcss:build before javascript dependencies will be installed by javascript:build and tailwind just have nothing to scan.
Maybe it could be solved by mounting tailwindcss:build to javascript:build if it defined?
More details about my case:
In my app I use Tailwindcss-rails, jsbundling-rails, with esbuild and fullcalendar.
I wanted to override some classes and added to my application.tailwind.css somehting like this:
And also set path fullcalendar in my tailwind.config.js:
Overriden classes worked perfectly in dev environment, because I aways have node_modules installed at the moment of running tailwindcss:build. But in production (in my case staging) environment when I run assets:precompile tailwindcss generated all styles excepting related to fullcalendar.
The text was updated successfully, but these errors were encountered: