How can I enable assets minifying in development environment?

I was trying an concept and found an weird issue when trying to enable compression in my development environment.

I'd like to be able to run my specs on the minified versions as well, so, using my rails_sandbox_jasmine gem, I'd like to use it this way:

SIMULATE_PRODUCTION=1 rake sandbox_assets:serve

And in my development.rb, I've set it to:

   config.assets.js_compressor = :uglifier    config.assets.compress = !!ENV['SIMULATE_PRODUCTION']    config.assets.digest = !!ENV['SIMULATE_PRODUCTION']    config.assets.debug = !ENV['SIMULATE_PRODUCTION']

The debug (concatenation) and digest feature work but the generated assets are not minified.

Is that expected?

Thanks in advance, Rodrigo.

It appears that you have to be explicit in specifying the files that get compiled.

config.assets.precompile += %(asset1.js asset2.js style1.css)

The default just contains application.(css|js)

Hopefully this assists you.

Hi, Simon, thanks for your reply.

I guess you meant %w() instead of %(), right?

Indeed, the precompile options is required, but that alone won't

make my application work.

I've tested in a fresh Rails application and the trick worked for


I'm investigating what could be causing this strange issue in my own


I'll let you know if I find some bug in any included gem...


I tried really hard to replicate the issue in a separate application for almost a full hour and I couldn’t.

It only happens to one file and it doesn't happen if I rename it.

Since this seems to be an odd case instead of a general issue, I

gave up on trying to identify it as I don’t actually need to run my specs in minified versions of my assets and if I needed to it was just a matter of renaming the spec affected by this bug.

Also, for the record, it doesn't seem that config.assets.precompile

option is required for this to work as my other assets were being minified even when not specified in the precompile option.