Skip to content

Expose USE_NEW_CSS_PIPELINE variable to Webpack and Vite

What does this merge request do and why?

We want to move to Node to compile our SASS files, instead of relying on Sprockets/sassc-rails.

This feature is disabled by default, and Rails would continue to compile SASS. When enabled, Rails would no longer compile SASS files, and instead either Webpack or Vite would do the compilation in development

This variable is also exposed to all Rails processes to be consistent in loading the correct gems in every rails process

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Start app normally using gdk start
  2. Apps should be compiled by sassc-rails and Sprockets
  3. app/assets/builds should remain empty during development

To test with css: true and use cssbundling-rails and Node Sass:

  1. Set css: true
  2. restart Rails
  3. app/assets/builds should be populated with .css files

in both cases running USE_NEW_CSS_PIPELINE=... bin/rails c and then checking if defined?(SassC) or defined?(Cssbundling) are loaded.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • [z] Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

/cc @leipert

Edited by Muhammed Ali

Merge request reports