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

Use Thor's `apply` instead of a prerequisite task #150

Closed jonathanhefner closed 5 months ago

jonathanhefner commented 5 months ago

The css:install:shared task serves only as a prerequisite for the other installer tasks; it should not be run on its own (nor listed with rake --tasks). By replacing this task with corresponding calls to Thor's apply method, we avoid the overhead of running bin/rails app:template (and bundle install) multiple times.


As a point of comparison, running the tests from #149 without this PR:

  $ time bundle exec appraisal rake test

  real  1m3.454s
  user  11m54.481s
  sys   2m39.424s

And running them with this PR:

  $ time bundle exec appraisal rake test

  real  0m43.129s
  user  7m49.613s
  sys   1m48.380s