From 7e3a19e5f2e16a69c7c0e05e7a0a1e53a07c1266 Mon Sep 17 00:00:00 2001 From: xhagrg Date: Thu, 13 Apr 2017 16:34:20 -0500 Subject: [PATCH] Rake file for node_modules update. --- lib/tasks/node_components.rake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/tasks/node_components.rake diff --git a/lib/tasks/node_components.rake b/lib/tasks/node_components.rake new file mode 100644 index 0000000..6ba2f1c --- /dev/null +++ b/lib/tasks/node_components.rake @@ -0,0 +1,17 @@ +namespace :node_packages do + desc 'install packages' + task install: :environment do + Dir.chdir("#{Rails.root}/vendor") do + system('npm', 'install') + end + end + + desc 'compile assets' + task compile: :environment do + Dir.chdir("#{Rails.root}/vendor") do + compile_strategy = 'start' + compile_strategy = 'start:prod' if Rails.env.production? + system('npm', compile_strategy) + end + end +end \ No newline at end of file