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

Namespace helper methods for css:build command #132

Closed excid3 closed 9 months ago

excid3 commented 9 months ago

Methods defined in Rake files are added to the global namespace. This means cssbundling-rails and jsbundling-rails using the same build_command method name get overridden by one or the other.

This introduces a module to namespace these methods and provides a place for any future methods to be defined.

Since these only apply to the tasks in build.rake, I just defined the module there, but we could extract it to a file and require it instead.

Fixes #131

cc @terracatta

excid3 commented 9 months ago

@rafaelfranca heads up on this and https://github.com/rails/jsbundling-rails/pull/172 👍

terracatta commented 9 months ago

Thanks @excid3 TIL that methods defined here are in a shared namespace with all other rake tasks. I've updated my open PRs as well. https://github.com/hotwired/turbo-rails/pull/494 and https://github.com/hotwired/stimulus-rails/pull/125.