# barber patches to re-route raw compilation via ember compat handlebars class Barber::Precompiler def sources [File.open("#{Rails.root}/vendor/assets/javascripts/handlebars.js"), precompiler] end def precompiler if !@precompiler source = File.read("#{Rails.root}/app/assets/javascripts/discourse/lib/raw-handlebars.js.es6") template = Tilt::ES6ModuleTranspilerTemplate.new {} transpiled = template.babel_transpile(source) # very hacky but lets us use ES6. I'm ashamed of this code -RW transpiled.gsub!(/^export .*$/, '') @precompiler = StringIO.new <