
For some reason uflify fails on regular ember.js build. Using production build fixes the problem and we should do it anyway - our assets pipeline does some debug version cleaning, but I'm not sure if it's still compatible with what's done when generating Ember's production build.
100 lines
2.0 KiB
Plaintext
100 lines
2.0 KiB
Plaintext
$: << 'lib'
|
|
|
|
require 'rake-pipeline-web-filters'
|
|
require 'rake-pipeline-i18n-filters'
|
|
require 'travis/assets'
|
|
require 'compass'
|
|
|
|
Encoding.default_external = Encoding::UTF_8
|
|
Encoding.default_internal = Encoding::UTF_8
|
|
|
|
assets ||= Travis::Assets.new
|
|
assets.setup_compass
|
|
assets.update_version
|
|
|
|
output 'assets/scripts/config'
|
|
input 'locales' do
|
|
match '**/*.yml' do
|
|
i18n_js { 'locales.js' }
|
|
end
|
|
end
|
|
|
|
output 'public/scripts'
|
|
input assets.scripts do
|
|
match '**/*.hbs' do
|
|
travis_handlebars :precompile => false # assets.production?
|
|
concat 'templates.js'
|
|
end
|
|
|
|
match '**/*.coffee' do
|
|
coffee_script
|
|
end
|
|
|
|
match 'vendor/**/*.js' do
|
|
if assets.production?
|
|
reject 'ember.js'
|
|
else
|
|
reject 'ember.prod.js'
|
|
end
|
|
safe_concat assets.vendor_order, 'vendor.js'
|
|
end
|
|
|
|
match '{spec,spec/integration,spec/unit,spec/unit/views}/*.js' do
|
|
concat 'spec/specs.js'
|
|
end
|
|
|
|
match 'spec/support/*.js' do
|
|
concat 'spec/support.js'
|
|
end
|
|
|
|
match 'spec/vendor/*.js' do
|
|
concat assets.spec_vendor_order, 'spec/vendor.js'
|
|
end
|
|
|
|
match 'spec/{vendor,support,specs}.js' do
|
|
concat ['spec/vendor.js', 'spec/support.js', 'spec/specs.js'], 'specs.js'
|
|
end
|
|
|
|
match %r(^(?!vendor|spec).*\.js$) do
|
|
modules = proc { |input| input.path.gsub(%r((^app/|lib/|\.js$)), '') }
|
|
minispade(string: assets.development?, rewrite_requires: true, module_id_generator: modules)
|
|
end
|
|
|
|
match %r(^(?!spec).*\.js$) do
|
|
paths = ['min/app.js']
|
|
paths.push 'app.js' unless assets.production?
|
|
concat ['vendor.js'], paths
|
|
end
|
|
|
|
if assets.production?
|
|
match 'min/app.js' do
|
|
strip_debug
|
|
# uglify squeeze: true
|
|
concat 'app.js'
|
|
end
|
|
end
|
|
end
|
|
|
|
output 'public/styles'
|
|
input assets.styles do
|
|
match '**/*.{scss,sass}' do
|
|
sass assets.production? ? { style: :compressed } : {}
|
|
concat [], ['app.css']
|
|
end
|
|
end
|
|
|
|
output 'public/images'
|
|
input assets.images do
|
|
skip %r(^ui/)
|
|
match '**/*' do
|
|
copy
|
|
end
|
|
end
|
|
|
|
# output 'public'
|
|
# input assets.static do
|
|
# match '**/*' do
|
|
# copy
|
|
# end
|
|
# end
|