Skip to content

Commit 94a4dce

Browse files
committed
Patch Jsbundling and execjs commands with relateive bun binary
1 parent 76d3e1c commit 94a4dce

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

config/initializers/assets.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,24 @@
55

66
# Add additional assets to the asset load path.
77
# Rails.application.config.assets.paths << Emoji.images_path
8+
9+
# Use relative standalone bun binary when running the assets:precompile task
10+
module Jsbundling
11+
module Tasks
12+
def install_command
13+
"./bun install"
14+
end
15+
16+
def build_command
17+
"./bun run build"
18+
end
19+
end
20+
end
21+
22+
# Fix uglifier error looking for bun system-wide
23+
ExecJS::Runtimes::Bun = ExecJS::ExternalRuntime.new(
24+
name: "Bun.sh",
25+
command: [ "./bun" ],
26+
runner_path: ExecJS.root + "/support/bun_runner.js",
27+
encoding: "UTF-8"
28+
)

0 commit comments

Comments
 (0)