Skip to content

Commit

Permalink
fix: actually run vite inside bun (#492)
Browse files Browse the repository at this point in the history
When using bun, Runner would call into `bunx vite`, but the vite executable
has a node shebang which bunx respects so vite would actually run inside node.

This commit adds a --bun flag su that bunx ignores the node shebang.

https://bun.sh/docs/cli/bunx#shebangs
  • Loading branch information
pigoz authored Sep 4, 2024
1 parent a0203c0 commit 36d3e96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vite_ruby/lib/vite_ruby/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def vite_executable(*exec_args)
x = case config.package_manager
when 'npm' then %w[npx]
when 'pnpm' then %w[pnpm exec]
when 'bun' then %w[bun x]
when 'bun' then %w[bun x --bun]
when 'yarn' then %w[yarn]
else raise ArgumentError, "Unknown package manager #{ config.package_manager.inspect }"
end
Expand Down

0 comments on commit 36d3e96

Please sign in to comment.