Sha256: 3382d7e557a7bdfa49fd4a6d3c95efa39ce48ff3058d868d5f6f2d298e8f2f36

Contents?: true

Size: 1.55 KB

Versions: 25

Compression:

Stored size: 1.55 KB

Contents

# config/initializers/compression.rb

Rails.application.configure do
  # Use environment names or environment variables:
  # break unless Rails.env.production?
  break unless ENV['ENABLE_COMPRESSION'] == '1'

  # Strip all comments from JavaScript files, even copyright notices.
  # By doing so, you are legally required to acknowledge
  # the use of the software somewhere in your Web site or app:
  uglifier = Uglifier.new output: { comments: :none }

  # To keep all comments instead or only keep copyright notices (the default):
  # uglifier = Uglifier.new output: { comments: :all }
  # uglifier = Uglifier.new output: { comments: :copyright }

  config.assets.compile = true
  config.assets.debug = false

  config.assets.js_compressor = uglifier
  config.assets.css_compressor = :sass

  config.middleware.use Rack::Deflater
  config.middleware.insert_before ActionDispatch::Static, Rack::Deflater

  config.middleware.use HtmlCompressor::Rack,
    compress_css: true,
    compress_javascript: true,
    css_compressor: Sass,
    enabled: true,
    javascript_compressor: uglifier,
    preserve_line_breaks: false,
    remove_comments: true,
    remove_form_attributes: false,
    remove_http_protocol: false,
    remove_https_protocol: false,
    remove_input_attributes: true,
    remove_intertag_spaces: false,
    remove_javascript_protocol: true,
    remove_link_attributes: true,
    remove_multi_spaces: true,
    remove_quotes: true,
    remove_script_attributes: true,
    remove_style_attributes: true,
    simple_boolean_attributes: true,
    simple_doctype: false
end

Version data entries

25 entries across 24 versions & 1 rubygems

Version Path
keppler-2.1.22 installer/core/config/initializers/compression.rb
keppler-2.1.21 installer/core/config/initializers/compression.rb
keppler-2.1.20 installer/core/config/initializers/compression.rb
keppler-2.1.19 installer/core/config/initializers/compression.rb
keppler-2.1.18 testing-with-2.1.18/config/initializers/compression.rb
keppler-2.1.18 installer/core/config/initializers/compression.rb
keppler-2.1.17 installer/core/config/initializers/compression.rb
keppler-2.1.16 installer/core/config/initializers/compression.rb
keppler-2.1.15 installer/core/config/initializers/compression.rb
keppler-2.1.14 installer/core/config/initializers/compression.rb
keppler-2.1.13 installer/core/config/initializers/compression.rb
keppler-2.1.12 installer/core/config/initializers/compression.rb
keppler-2.1.11 installer/core/config/initializers/compression.rb
keppler-2.1.10 installer/core/config/initializers/compression.rb
keppler-2.1.9 installer/core/config/initializers/compression.rb
keppler-2.1.8 installer/core/config/initializers/compression.rb
keppler-2.1.7 installer/core/config/initializers/compression.rb
keppler-2.1.6 installer/core/config/initializers/compression.rb
keppler-2.1.5 installer/core/config/initializers/compression.rb
keppler-2.1.4 installer/core/config/initializers/compression.rb