Skip to content

Commit

Permalink
Allow NPM use for install/build
Browse files Browse the repository at this point in the history
  • Loading branch information
ksol committed Dec 5, 2023
1 parent 95a5472 commit 6048b4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tasks/jsbundling/build.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ module Jsbundling
def install_command
return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
return "npm install" if File.exist?('package-lock.json') || tool_exists?('npm')
raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
end

def build_command
return "bun run build" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn')
return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn') && !File.exist?('package-lock.json')
return "npm run build" if File.exist?('package-lock.json') || tool_exists?('npm')
raise "jsbundling-rails: No suitable tool found for building JavaScript"
end

Expand Down

0 comments on commit 6048b4f

Please sign in to comment.