rails / cssbundling-rails

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

Import errors when using CSSBundling + 3rd Party Gem assets #73

Closed rapito closed 2 years ago

rapito commented 2 years ago

Given a rails application that uses a gem like rails-assets-jstree. After trying to execute rails css:install:sass, I get a "Can't find stylesheet to import." error per each css asset that is inside a gem. I can perfectly follow the @import statement to the gem's asset.

Is there a necessary extra step to set cssbundling to be able to lookup inside included gems?

- `application.sass.scss`: 
```scss
// something something
@import 'jstree';
// something more
dhh commented 2 years ago

You have to manually change your Sass configuration to include the gem assets in the load path. Not something that happens automatically.