From 6e52934fde3612a5124b4b8e3cf5b8f3cf788f86 Mon Sep 17 00:00:00 2001 From: Template Bot Date: Sun, 20 Sep 2026 17:47:31 +0000 Subject: [PATCH] esbuild: remove --public-path=/assets **What** This removes the `--public-path=/assets` flag from our build scripts. **Why** The flag came from the jsbundling-rails generator. It only matters when esbuild copies files out via a `file` loader, which we don't use. If we ever did, it would break things: esbuild would write `url("/assets/font-HASH.woff2")`, which Propshaft leaves alone, so it would miss the fingerprinted file. Without the flag esbuild writes a relative path, which Propshaft rewrites correctly. For JS the only difference is the sourceMappingURL comment, and Propshaft rewrites both forms to the same fingerprinted path. See https://github.com/rails/jsbundling-rails/pull/204 Source: https://github.com/mockdeep/Rails-Template/pull/1496 --- bin/build | 1 - bin/build_css | 2 -- 2 files changed, 3 deletions(-) diff --git a/bin/build b/bin/build index c02a2c5d4..3e0dc7d4f 100755 --- a/bin/build +++ b/bin/build @@ -7,6 +7,5 @@ esbuild app/javascript/*.ts \ --sourcemap \ --format=iife \ --outdir=app/assets/builds \ - --public-path=/assets \ --alias:bootstrap=./node_modules/bootstrap/dist/js/bootstrap.bundle.js \ "$@" diff --git a/bin/build_css b/bin/build_css index e47d72980..ee44b45af 100755 --- a/bin/build_css +++ b/bin/build_css @@ -5,8 +5,6 @@ set -euo pipefail esbuild app/assets/stylesheets/application.css \ --bundle \ --outdir=app/assets/builds \ - --public-path=/assets \ - --asset-names=[name]-[hash].digested \ --external:/img/* \ --loader:.woff=file \ --loader:.woff2=file \