lib/tasks/vite/install_dependencies.rake in vite_rails-1.0.10 vs lib/tasks/vite/install_dependencies.rake in vite_rails-1.0.11

- old
+ new

@@ -1,20 +1,14 @@ # frozen_string_literal: true namespace :vite do - desc 'Support for older Rails versions. Install all JavaScript dependencies as specified via Yarn' + desc 'Install all JavaScript dependencies as specified via Yarn' task :install_dependencies do valid_node_envs = %w[test development production] node_env = ENV.fetch('NODE_ENV') { valid_node_envs.include?(Rails.env) ? Rails.env : 'production' } Dir.chdir(Rails.root) do - install_command = if Rails.root.join('yarn.lock').exist? - v1 = `yarn --version`.start_with?('1') - "yarn install #{ v1 ? '--no-progress --frozen-lockfile' : '--immutable' }" - elsif Rails.root.join('pnpm-lock.yaml').exist? - 'pnpm install' - else - 'npm ci' - end + v1 = `yarn --version`.start_with?('1') + install_command = "yarn install #{ v1 ? '--no-progress --frozen-lockfile' : '--immutable' } --production=false" system({ 'NODE_ENV' => node_env }, install_command) end end end