Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (48 sloc) 1.348 kB
require 'barber'
instance_eval File.read(EmberDev.support_path.join('Assetfile'))
class InlineHandlebarsPrecompiler < Rake::Pipeline::Filter
def precompile_templates(data)
data.gsub!(/Ember\.Handlebars\.compile\(['"](.*)['"]\)/) do
Barber::Ember::InlinePrecompiler.call($1)
end
end
def generate_output(inputs, output)
inputs.each do |input|
result = File.read(input.fullpath)
precompile_templates(result)
output.write result
end
end
end
distros = {
:full => %w(ember-easyForm)
}
output "dist"
distros.each do |name, modules|
name = "ember-easyForm"
input "dist/modules" do
module_paths = modules.map{|m| "#{m}.js" }
match "{#{module_paths.join(',')}}" do
concat(module_paths){ ["#{name}.js", "#{name}.prod.js"] }
end
match "#{name}.js" do
filter InlineHandlebarsPrecompiler
filter VersionInfo
filter EmberLicenseFilter
end
# Strip dev code
match "#{name}.prod.js" do
filter InlineHandlebarsPrecompiler
filter VersionInfo
filter EmberLicenseFilter
filter(EmberStripDebugMessagesFilter) { ["#{name}.prod.js", "min/#{name}.js"] }
end
# Minify
match "min/#{name}.js" do
uglify{ "#{name}.min.js" }
filter VersionInfo
filter EmberLicenseFilter
end
end
end
# vim: filetype=ruby
Jump to Line
Something went wrong with that request. Please try again.