Sha256: bd42e633d05f5c0b7069c4f3b8794ae4946874a7082526d82007d681f9c9d8a1

Contents?: true

Size: 327 Bytes

Versions: 3

Compression:

Stored size: 327 Bytes

Contents

require 'tilt'
require 'babel/transpiler'
require 'sprockets'

module ES6Tilt 
  class ES6Transformer< Tilt::Template
    self.default_mime_type = 'application/javascript'

    def prepare
    end

    def evaluate(scope, locals, &block)
      output = Babel::Transpiler.transform(data)
      output["code"]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
es6_tilt-0.0.3 lib/es6_tilt.rb
es6_tilt-0.0.2 lib/es6_tilt.rb
es6_tilt-0.0.1 lib/es6_tilt.rb