Sha256: 52bf6ad185dad901cda96e6aa9d254a8dbb172f375a3a44069ad61cadc22dd05

Contents?: true

Size: 521 Bytes

Versions: 11

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true

require 'opal/paths'

# The compiler runner will just output the compiled JavaScript
Opal::CliRunners::Compiler = ->(data) {
  options  = data[:options] || {}
  builder  = data.fetch(:builder)
  map_file = options[:map_file]
  output   = data.fetch(:output)

  compiled_source = builder.to_s
  compiled_source += "\n" + builder.source_map.to_data_uri_comment unless options[:no_source_map]
  output.puts compiled_source
  File.write(map_file, builder.source_map.to_json) if map_file

  0
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
opal-1.5.1 lib/opal/cli_runners/compiler.rb
opal-1.5.0 lib/opal/cli_runners/compiler.rb
opal-1.5.0.rc1 lib/opal/cli_runners/compiler.rb
opal-1.4.1 lib/opal/cli_runners/compiler.rb
opal-1.4.0 lib/opal/cli_runners/compiler.rb
opal-1.4.0.alpha1 lib/opal/cli_runners/compiler.rb
opal-1.3.2 lib/opal/cli_runners/compiler.rb
opal-1.3.1 lib/opal/cli_runners/compiler.rb
opal-1.3.0 lib/opal/cli_runners/compiler.rb
opal-1.3.0.rc1 lib/opal/cli_runners/compiler.rb
opal-1.3.0.alpha1 lib/opal/cli_runners/compiler.rb