Skip to content

Instantly share code, notes, and snippets.

@elia
Created February 25, 2015 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elia/e330d92d8b826d089c4f to your computer and use it in GitHub Desktop.
Save elia/e330d92d8b826d089c4f to your computer and use it in GitHub Desktop.
require 'opal'
Opal::BuilderProcessors.class_eval do
class SprocketsProcessor < self::JsProcessor
def self.match?(*)
true
end
def source
compiled.to_s + mark_as_required(@filename)
end
def requires
compiled.send(:required_assets).map(&:logical_path)
end
private
def compiled
@compiled ||= Rails.application.assets[@filename]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment