2016-09-24 03:00:46 +00:00
|
|
|
# frozen_string_literal: true
|
2016-08-08 13:58:23 +00:00
|
|
|
namespace :assets do
|
|
|
|
task :js_compile do
|
2016-09-24 03:00:46 +00:00
|
|
|
system 'npm install'
|
|
|
|
system 'npm run build'
|
2017-10-14 19:02:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
task :production_ready do
|
2016-10-04 15:43:42 +00:00
|
|
|
system 'bin/build-apidocs.sh' if Rails.env.production?
|
2017-10-14 19:02:41 +00:00
|
|
|
Rake::Task['perms:fix'].invoke if Rails.env.production?
|
2016-08-08 13:58:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-10-15 18:02:22 +00:00
|
|
|
# run before
|
2016-08-08 13:58:23 +00:00
|
|
|
Rake::Task[:'assets:precompile'].enhance([:'assets:js_compile'])
|
2017-10-15 18:02:22 +00:00
|
|
|
# run after
|
|
|
|
Rake::Task[:'assets:precompile'].enhance do
|
|
|
|
Rake::Task[:'assets:production_ready'].invoke
|
|
|
|
end
|