Skip to content

Commit

Permalink
Merge PR #40722
Browse files Browse the repository at this point in the history
Closes #40722.
  • Loading branch information
rafaelfranca committed Dec 8, 2020
1 parent 188fb07 commit b087511
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion railties/lib/rails/tasks/yarn.rake
Expand Up @@ -8,7 +8,15 @@ namespace :yarn do
node_env = ENV.fetch("NODE_ENV") do
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
end
system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install --no-progress --frozen-lockfile")

yarn_flags =
if `#{Rails.root}/bin/yarn --version`.start_with?("1")
"--no-progress --frozen-lockfile"
else
"--immutable"
end

system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install #{yarn_flags}")
end
end

Expand Down

0 comments on commit b087511

Please sign in to comment.