70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
$: << 'lib'
|
|
|
|
require 'rake-pipeline-web-filters'
|
|
require 'rake-pipeline/travis'
|
|
require 'compass'
|
|
|
|
roots ||= [Pathname.new(File.expand_path('.'))]
|
|
|
|
Compass.configuration.images_path = 'assets/images'
|
|
Compass.configuration.add_import_path File.expand_path('../assets/stylesheets', __FILE__)
|
|
|
|
Travis::Version.update
|
|
|
|
output 'public/javascripts'
|
|
input roots.map { |root| root.join('assets/javascripts').to_s } do
|
|
match 'app/templates/**/*.hbs' do
|
|
filter Travis::HandlebarsFilter
|
|
concat 'app/templates.js'
|
|
end
|
|
|
|
match %r(\.coffee$) do
|
|
coffee_script
|
|
end
|
|
|
|
match %r(^(travis|(app|config|data|lib)/.*)\.js$) do
|
|
modules = proc { |input| input.path.gsub(%r((^app/|^lib/|\.js$)), '') }
|
|
minispade(string: true, rewrite_requires: true, module_id_generator: modules)
|
|
concat [], ['dev/app.js', 'min/app.js']
|
|
end
|
|
|
|
match 'vendor/**/*.js' do
|
|
precedence = %w(jquery.min minispade handlebars ember).map { |name| "vendor/#{name}.js" }
|
|
concat precedence, ['dev/vendor.js', 'min/vendor.js']
|
|
end
|
|
|
|
match 'min/**/*.js' do
|
|
filter Travis::ProductionFilter
|
|
uglify max_line_length: 32 * 1024, squeeze: true
|
|
filter Travis::SafeConcatFilter do
|
|
'application.min.js'
|
|
end
|
|
end
|
|
|
|
match 'dev/**/*.js' do
|
|
concat 'application.js'
|
|
end
|
|
end
|
|
|
|
output 'public/stylesheets'
|
|
input roots.map { |root| root.join('assets/stylesheets').to_s } do
|
|
match '**/*.{scss,sass}' do
|
|
filter Rake::Pipeline::Web::Filters::SassFilter
|
|
concat [], 'application.css'
|
|
end
|
|
end
|
|
|
|
output 'public/images'
|
|
input roots.map { |root| root.join('assets/images').to_s } do
|
|
match '**/*' do
|
|
copy
|
|
end
|
|
end
|
|
|
|
output 'public'
|
|
input roots.map { |root| root.join('assets/public').to_s } do
|
|
match '**/*' do
|
|
copy
|
|
end
|
|
end
|