Open bufordtaylor opened 1 year ago
Hi Buford!
Please specify which tag helpers you are using to reference the built assets, by sharing a code sample or providing a minimal reproduction.
Based on what you've shared so far, it's likely that one of the generated CSS files corresponds to a CSS entrypoint, while the other one corresponds to the CSS imported by a JS entrypoint. You would want to reference the latter, but might be using vite_stylesheet_tag
instead of vite_javascript_tag
.
I had this exact same issue! I'm not sure if it's a bug or not but I worked around it by renaming javascript/entrypoints/application.css
(the one with my actual app's source/Tailwind imports, etc.) to styles.css
and referenced it with <%= vite_stylesheet_tag "styles" %>
so it doesn't get clobbered by the stylesheet <%= vite_javascript_tag "application" %>
spits out for JS-generated styles.
bundle update vite_ruby
.Description π
I'm attempting to use
vite_rails
andvite_ruby
to build assets for a rails 7 app on heroku.It's strangely building the assets twice and then pointing to the wrong one. Here is the problem I see:
Notice these two lines in particular
The first one is my normal css file with some minor styling. The second is the same file + tailwindcss.
When I go to look at the production site on heroku, it points to the wrong one
I'm just not sure I can go about debugging this. I've followed the instructions on https://vite-ruby.netlify.app/guide/deployment.html#using-heroku and have an identical setup they have.