rails / sass-rails

Ruby on Rails stylesheet engine for Sass
MIT License
859 stars 333 forks source link

Unclear how to get production-like compilation in development #419

Closed vemv closed 5 years ago

vemv commented 6 years ago

What

I'd need to use production-like compilation settings, but in my development environment.

That seems hard given this statement of yours:

:style - This option is not supported. This is determined by the Rails environment. It's :expanded only on development, otherwise it's :compressed.

My understanding is that the notion of development is hardcoded.

I tried to create a new environment (development_alt) with production-like Rails config, to no avail. The emitted css is still not as compressed as when compiling the assets with RAILS_ENV=production.

Why I need this

The emitted CSS should be smaller than 50KB to be AMP-compliant, so I stop receiving false alarms when running its validator. This is a nuisance in development and predictably could be a problem in CI.

Cheers - Victor

vemv commented 6 years ago

Bypassed the issue by always using the mentioned environment (development_alt), setting it as the default one in config/boot.rb, instead of using it just for compilation