lib/es6_tilt.rb in es6_tilt-0.1.0 vs lib/es6_tilt.rb in es6_tilt-0.1.1
- old
+ new
@@ -1,8 +1,9 @@
require 'tilt'
require 'sprockets'
require 'tempfile'
+require 'babel/transpiler'
module ES6Tilt
class ES6Transformer< Tilt::Template
self.default_mime_type = 'application/javascript'
@@ -12,10 +13,10 @@
def evaluate(scope, locals, &block)
location = File.dirname(file)
compacted = Tempfile.new('compacted', location)
- `#{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}`
+ 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