diff --git a/lib/requirejs/rails/config.rb b/lib/requirejs/rails/config.rb index 93862abf..8db42ec1 100644 --- a/lib/requirejs/rails/config.rb +++ b/lib/requirejs/rails/config.rb @@ -14,6 +14,7 @@ class Config < ::ActiveSupport::OrderedOptions def initialize(application) super self.manifest = nil + self.js_compressor = nil self.logical_asset_filter = [/\.js$/, /\.html$/, /\.txt$/] self.tmp_dir = application.root + 'tmp' diff --git a/lib/requirejs/rails/engine.rb b/lib/requirejs/rails/engine.rb index 995dce06..7c957053 100644 --- a/lib/requirejs/rails/engine.rb +++ b/lib/requirejs/rails/engine.rb @@ -20,6 +20,8 @@ class Engine < ::Rails::Engine config.assets.precompile += config.requirejs.precompile + config.requirejs.js_compressor ||= config.assets.js_compressor + # Check for the `requirejs:precompile:all` top-level Rake task and run the following initialization code. if defined?(Rake.application) && Rake.application.top_level_tasks == ["requirejs:precompile:all"] # Prevent Sprockets from freezing the assets environment, which allows JS compression to be toggled on a per- diff --git a/lib/tasks/requirejs-rails_tasks.rake b/lib/tasks/requirejs-rails_tasks.rake index 48240378..0e83456f 100644 --- a/lib/tasks/requirejs-rails_tasks.rake +++ b/lib/tasks/requirejs-rails_tasks.rake @@ -95,7 +95,7 @@ OS X Homebrew users can use 'brew install node'. # Save the original JS compressor and cache, which will be restored later. - original_js_compressor = requirejs.env.js_compressor + original_js_compressor = requirejs.config.js_compressor requirejs.env.js_compressor = false original_cache = requirejs.env.cache