Skip to content

Compilation step not copying over built css to public/assets folder #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
olimart opened this issue Nov 22, 2022 · 4 comments
Closed

Compilation step not copying over built css to public/assets folder #107

olimart opened this issue Nov 22, 2022 · 4 comments

Comments

@olimart
Copy link

olimart commented Nov 22, 2022

As per the README

This output is then picked up by the asset pipeline, digested, and copied into public/assets, as any other asset pipeline file.

However, no CSS file (application.css) makes it to public/assets when running rails assets:precompile (only JS).

In Package.json I added build script

"build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"

I'm also using sprockets-rails (3.4.2)

Any idea to get this working?

@jasonfb
Copy link

jasonfb commented Dec 3, 2022

how did you start your new rails app, specifically? Did you start with --javascript=esbuild or --css=boostrap or both?

@olimart
Copy link
Author

olimart commented Dec 4, 2022

both --javascript=esbuild --css=boostrap

@jasonfb
Copy link

jasonfb commented Dec 5, 2022

seems like it works for me following these steps

rails new Test3 --javascript=esbuild --css=bootstrap &&
cd Test3/ &&
bundle install && git add . && git commit -m "initial commit" &&
rails assets:precompile

Monosnap Test3 – README md 2022-12-05 10-36-06

@olimart
Copy link
Author

olimart commented Dec 6, 2022

Hey @jasonfb thanks for checking in.
I gave it another try and it seems to be working.

The installation fails at different steps:

  • build & build:css not added to package.json
  • Need to add "@hotwired/turbo": "7.2.4" in package.json
  • Turbo import must be declared as import * as Turbo from "@hotwired/turbo"

but at least I do see application.css in the list of compiled files under public/assets.
wil try to remember which commands I run when it was not working.

@dhh dhh closed this as completed Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants