Rakefile in crono_trigger-0.4.0 vs Rakefile in crono_trigger-0.5.0
- old
+ new
@@ -8,14 +8,16 @@
pwd = File.expand_path('../', __FILE__)
gemfiles = Dir.glob(File.join(pwd, "gemfiles", "*.gemfile")).map { |f| File.basename(f, ".*") }
namespace :js do
+ desc "Cleanup built javascripts"
task :clean do
rm_r(File.join(pwd, "web", "app", "build")) if File.exist?(File.join(pwd, "web", "app", "build"))
rm_r(File.join(pwd, "web", "public"))
end
+ desc "build javascripts"
task build: [:clean] do
Dir.chdir(File.join(pwd, "web", "app"))
sh({"PUBLIC_URL" => "<%= URI.parse(url('/')).path.chop %>"}, "npm run build") do |ok, res|
raise "failed to build JS" unless ok