esbuild: remove --public-path=/assets - #1619
Merged
Merged
Conversation
**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 rails/jsbundling-rails#204
Source: mockdeep/Rails-Template#1496
mockdeep
force-pushed
the
template-update/1496
branch
from
September 20, 2026 18:37
da96ffa to
6e52934
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Template Update
What
This removes the
--public-path=/assetsflag from our build scripts.Why
The flag came from the jsbundling-rails generator. It only matters when
esbuild copies files out via a
fileloader, 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 itwould 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 rails/jsbundling-rails#204
Cherry-picked from mockdeep/Rails-Template#1496
Warning
Conflicts were automatically resolved by Claude. Please review these files carefully:
bin/buildbin/build_css