No commit activity in last 3 years
No release in over 3 years
UglifierWithSourceMaps overrides parts of sprockets to create sourcemaps using uglifier for your javascript assets. It is meant to be used in production.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

~> 3.2.19
~> 2.2.2
>= 2.5.0
 Project Readme

UglifierWithSourceMaps

Create sourcemaps when compressing assets in your Rails 3.2 applications.

This gem uses Uglifier to create sourcemaps for your concatenated javascripts in Rails 3.2.x. It is meant to use as a replacement javascript compressor.

Note: This gem is for Rails 3.2.x

For Rails 4.2 see: https://github.com/AlexanderPavlenko/sprockets_uglifier_with_source_maps

Installation

Add this line to your application's Gemfile:

gem 'uglifier_with_source_maps'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uglifier_with_source_maps

Usage

In your rails applications environment configuration add this:

config.assets.js_compressor = :uglifier_with_source_maps

If you need to pass options to uglifier:

config.assets.js_compressor = UglifierWithSourceMaps::Compressor.new({
  output: {
    beautify: true, indent_level: 2, comments: :none
    }
  }) if defined? ::UglifierWithSourceMaps

Your assets will be built as normal, and maps concatenated sources will be provided as well in asset_path/maps and asset_path/sources

Example rake assets:precompile

# application.js
rake assets:precompile

# -> public/assets/application-ab258eecc169e5febb9da42389481bff.js
# -> public/assets/maps/application-ab258eecc169e5febb9da42389481bff.map
# -> public/assets/sources/application-ab258eecc169e5febb9da42389481bff.js

Dependencies

  • uglifier >= 2.5
  • sprockets ~> 2.2.2
  • actionpack ~> 3.2.19

Contributing

  1. Fork it ( https://github.com/[my-github-username]/uglifier_with_source_maps/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request