From cebf336741e463b52912f61c9d940b8e08df912e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20=C3=96zbek?= Date: Tue, 8 Oct 2024 08:22:03 +0200 Subject: [PATCH] Remove --public-path from build_script The esbuild option `--public-path` is used to define absolute asset hosts for file loaders. Setting `--public-path=/assets` will interfere with downstream asset processing (for example Sprocket's AssetUrlProcessor), because the corresponding asset can't be found on disk. Since asset urls are rewritten anyway, removing --public-path doesn't have a negative impact. https://esbuild.github.io/api/#public-path --- lib/install/esbuild/install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/install/esbuild/install.rb b/lib/install/esbuild/install.rb index a9f91bc..ed83c2d 100644 --- a/lib/install/esbuild/install.rb +++ b/lib/install/esbuild/install.rb @@ -5,7 +5,7 @@ run "yarn add --dev esbuild" say "Add build script" -build_script = "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets" +build_script = "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds" case `npx -v`.to_f when 7.1...8.0