14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/jass/bundle_processor.rb', line 14
def call(input)
env, filename = input.fetch(:environment), input.fetch(:filename)
dependencies = Set.new(input.fetch(:metadata).fetch(:dependencies))
globals = input.fetch(:metadata).fetch(:globals, {})
bundle_root = Pathname.new(filename).dirname
bundle = Jass.compiler.bundle(filename, Jass.input_options, globals: globals)
dependencies += bundle.fetch('map').fetch('sources').map { |dep| Sprockets::URIUtils.build_file_digest_uri(bundle_root.join(dep).to_s) }
{ data: bundle.fetch('code'),
dependencies: dependencies,
map: bundle.fetch('map') }
end
|