Skip to content

Instantly share code, notes, and snippets.

@jschilli
Forked from ppcano/assetfile.rb
Created March 13, 2012 17:33
Show Gist options
  • Save jschilli/2030082 to your computer and use it in GitHub Desktop.
Save jschilli/2030082 to your computer and use it in GitHub Desktop.
Attempting concat multiple match to contact to the same output file
input "assets/vendor" do
match "*.js" do
filter Rake::Pipeline::OrderingConcatFilter,
["minispade.js", "qrcode.js", "jquery.js", "jquery.transit.js"], "app.js"
end
end
input "packages" do
match "*/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
end
input "app" do
match "*/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
end
<script type="text/javascript" src="source/app.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment