Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I disable compression when in development mode? #175

Open
CVertex opened this issue Jul 15, 2014 · 4 comments
Open

How do I disable compression when in development mode? #175

CVertex opened this issue Jul 15, 2014 · 4 comments

Comments

@CVertex
Copy link

CVertex commented Jul 15, 2014

Excuse the newbie question.
Inside of assets , as per docs I've specified compression for both js and css like so:

js_compression  :jsmin
css_compression :simple

It's useful for debugging that compression be disabled during dev.

How do I disable compression when the environment is development?

Thanks in advance.

@rstacruz
Copy link
Owner

try this:

assets {
  # rest of your config here
}

configure :production do
  assets {
    js_compression :jsmin
  }
end

@CVertex
Copy link
Author

CVertex commented Jul 15, 2014

Thanks! That works for js. If I leave off the css_compression for non-production, it's doing compression anyway. Any ideas?

@CVertex
Copy link
Author

CVertex commented Jul 15, 2014

I'm trying my hand at understanding the engines built-in. All the css compressors seem to do something. There isn't a "simple" compressor that does no transformation

@CVertex
Copy link
Author

CVertex commented Jul 15, 2014

Ok, I tried writing my own dumb engine, like so:

class NoneEngine < Sinatra::AssetPack::Engine
  def css(str, options={})
    str
  end
end

Sinatra::AssetPack::Compressor.register :css, :none, NoneEngine

then declaring

css_compression :none

But that still compresses my CSS :(
I'm confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants