rails / cssbundling-rails

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

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

Closed olimart closed 1 year ago

olimart commented 1 year ago

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 commented 1 year ago

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

olimart commented 1 year ago

both --javascript=esbuild --css=boostrap

jasonfb commented 1 year ago

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 commented 1 year ago

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

The installation fails at different steps:

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.