nimblehq / rails-templates

Our optimized Rails templates used in our projects
https://nimblehq.co
MIT License
102 stars 25 forks source link

[Remove Node.js] Use dart-sass for SCSS #523

Open malparty opened 2 months ago

malparty commented 2 months ago

inherit #431

[!NOTE] This issue does NOT include any code change in the Rails template (yet), as these will be based on the RFC results.

Why

SCSS build currently relies on Node.js.

Checklist

Insight 📝

The cssbundling-rails gem relies on Node.js. [Rails Guides](https://guides.rubyonrails.org/asset_pipeline.html#dartsass-rails) recommend using the dartsass-rails to remove Node.js dependency.

./bin/bundle add dartsass-rails
./bin/rails dartsass:install

[!NOTE] It turns out import-maps is limited to JS and won’t let you pin other assets like SCSS or images. https://github.com/rails/importmap-rails/issues/80

If you need Node for anything, I'd use it for everything. The benefit of import maps is that it provides a path with no Node at all. cssbundling-rails and jsbundling-rails is a great combo to use with Bootstrap 👍” DHH[source](https://github.com/rails/importmap-rails/issues/107#issuecomment-1049793920)

Who Benefits?

malparty commented 2 months ago

Issue started in https://github.com/nimblehq/cx-web/pull/757