Rodrigo Rosenfeld Rosas
2012-May-24 16:30 UTC
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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Simon de Boer
2012-May-25 12:57 UTC
Re: How can I enable assets minifying in development environment?
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. On Thursday, 24 May 2012 12:30:02 UTC-4, Rodrigo Rosenfeld Rosas wrote:> > 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. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/rPy5g41bdRUJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Rodrigo Rosenfeld Rosas
2012-May-25 14:24 UTC
Re: Re: How can I enable assets minifying in development environment?
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 it. I''m investigating what could be causing this strange issue in my own application... I''ll let you know if I find some bug in any included gem... Thanks, Rodrigo. Em 25-05-2012 09:57, Simon de Boer escreveu:> 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. > > > On Thursday, 24 May 2012 12:30:02 UTC-4, Rodrigo Rosenfeld Rosas wrote: > > 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. > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/rPy5g41bdRUJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Rodrigo Rosenfeld Rosas
2012-May-25 15:21 UTC
Re: Re: How can I enable assets minifying in development environment?
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. Cheers, Rodrigo. Em 25-05-2012 11:24, Rodrigo Rosenfeld Rosas escreveu:> 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 it. > > I''m investigating what could be causing this strange issue in my own > application... > > I''ll let you know if I find some bug in any included gem... > > Thanks, > Rodrigo. > > Em 25-05-2012 09:57, Simon de Boer escreveu: >> 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. >> >> >> On Thursday, 24 May 2012 12:30:02 UTC-4, Rodrigo Rosenfeld Rosas wrote: >> >> 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. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Ruby on Rails: Core" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-core/-/rPy5g41bdRUJ. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.