diff options
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r-- | railties/lib/rails/tasks/framework.rake | 2 | ||||
-rw-r--r-- | railties/lib/rails/tasks/yarn.rake | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index 7dfcd14bd0..1a3711c446 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -40,7 +40,7 @@ namespace :app do namespace :update do require "rails/app_updater" - # desc "Update config/boot.rb from your current rails install" + # desc "Update config files from your current rails install" task :configs do Rails::AppUpdater.invoke_from_app_generator :create_boot_file Rails::AppUpdater.invoke_from_app_generator :update_config_files diff --git a/railties/lib/rails/tasks/yarn.rake b/railties/lib/rails/tasks/yarn.rake index 10703a1808..cf45a392e8 100644 --- a/railties/lib/rails/tasks/yarn.rake +++ b/railties/lib/rails/tasks/yarn.rake @@ -3,7 +3,13 @@ namespace :yarn do desc "Install all JavaScript dependencies as specified via Yarn" task :install do - system("./bin/yarn install --no-progress --frozen-lockfile --production") + # Install only production deps when for not usual envs. + valid_node_envs = %w[test development production] + node_env = ENV.fetch("NODE_ENV") do + rails_env = ENV["RAILS_ENV"] + valid_node_envs.include?(rails_env) ? rails_env : "production" + end + system({ "NODE_ENV" => node_env }, "./bin/yarn install --no-progress --frozen-lockfile") end end |