Skip to content

Instantly share code, notes, and snippets.

@ppcano
Created March 13, 2012 17:38
Show Gist options
  • Save ppcano/2030110 to your computer and use it in GitHub Desktop.
Save ppcano/2030110 to your computer and use it in GitHub Desktop.
assetfile
input "app" do
match "app/lib/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
#id.sub!('/tests', '/~tests')
id
}
filter ConcatFilter, "app.js"
end
# also include app, it could be improved
match "packages/*/lib/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('packages/', '')
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
#id.sub!('/tests', '/~tests')
id
}
filter ConcatFilter, "app.js"
end
match "vendor/cordova-1.5.0.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/jquery.ui.map.min.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/jquery.qrcode.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/jquery.transit.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/jquery.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/qrcode.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
match "vendor/minispade.js" do
uglify if ( ENV['YOIN_ENV'] == 'prod' )
filter ConcatFilter, "app.js"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment