Class: ES6Tilt::ES6Transformer

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/es6_tilt.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/es6_tilt.rb', line 13

def evaluate(scope, locals, &block)

  location = File.dirname(file)
  compacted = Tempfile.new('compacted', location)

  command = `#{Rails.root.join('node_modules','.bin')}/rollup -f iife --no-indent -c #{Rails.root}/rollup.config.js -n #{File.basename(file, ".*").camelize} -- #{file} > #{compacted.path}`

  output = compacted.read

  compacted.close
  compacted.unlink
  output
end

#prepareObject



10
11
# File 'lib/es6_tilt.rb', line 10

def prepare
end