Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow NPM use for install/build #179

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/tasks/jsbundling/build.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ 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 "yarn install" if File.exist?('yarn.lock') || (tool_exists?('yarn') && !File.exist?('package-lock.json'))
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