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.
- Start app normally using
gdk start
- Apps should be compiled by
sassc-rails
and Sprockets -
app/assets/builds
should remain empty during development
To test with css: true
and use cssbundling-rails
and Node Sass:
- Set
css: true
- restart Rails
-
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:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
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 theCHANGELOG.md
.
/cc @leipert