diff --git a/flowerbox-delivery.gemspec b/flowerbox-delivery.gemspec index a956c6e..ee89fa6 100644 --- a/flowerbox-delivery.gemspec +++ b/flowerbox-delivery.gemspec @@ -28,4 +28,5 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'rack' gem.add_runtime_dependency 'sprockets' gem.add_runtime_dependency 'coffee-script' + gem.add_runtime_dependency 'sprockets-vendor_gems' end diff --git a/lib/flowerbox/delivery/sprockets_handler.rb b/lib/flowerbox/delivery/sprockets_handler.rb index 4dab5be..495a23d 100644 --- a/lib/flowerbox/delivery/sprockets_handler.rb +++ b/lib/flowerbox/delivery/sprockets_handler.rb @@ -1,6 +1,7 @@ require 'sprockets' require 'sprockets/engines' require 'forwardable' +require 'sprockets-vendor_gems' module Flowerbox::Delivery class SprocketsHandler @@ -8,7 +9,7 @@ module Flowerbox::Delivery attr_reader :files, :options - def_delegators :environment, :append_path + def_delegators :environment, :append_path, :register_engine def initialize(options) @options = options @@ -27,7 +28,7 @@ module Flowerbox::Delivery def environment return @environment if @environment - @environment = Sprockets::Environment.new + @environment = Sprockets::EnvironmentWithVendoredGems.new @environment.unregister_postprocessor('application/javascript', Sprockets::SafetyColons) @environment.register_postprocessor('application/javascript', Flowerbox::Delivery::Tilt::EnsureSavedFile) @environment.unregister_bundle_processor('text/css', Sprockets::CharsetNormalizer)