Skip to content

stylesheet_link_tag :all and :app includes build files #242

@justinfrench

Description

@justinfrench

I'm using a pretty fresh Rails 8 app generated with rails new foo --css=tailwind. The standard application.html.erb includes the following:

<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>

The problem is that tailwindcss-rails is adding CSS files to app/assets/builds/tailwind/whatever.css, which are being automatically included.

I found the issue while tinkering with the experimental Engine support in tailwindcss-rails (which produced a file that shouldn't be served directly to customers, it needs to be added with an @import to tailwind/application.css), but I think it applies to anything that adds files to app/assets/builds/.

On one hand, I can understand why it's including all CSS files in assets/, but on the other hand, I don't think build files should be included. They're also treated differently in Rails' standard .gitignore.

The work-around is to avoid using :all or :app so I'm not stuck, but I think this is unexpected behaviour, and I wanted to raise the issue here for awareness and discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions