Skip to content

esbuild: remove --public-path=/assets - #1619

Merged
mockdeep merged 1 commit into
mainfrom
template-update/1496
Sep 20, 2026
Merged

mockdeep merged 1 commit into
mainfrom
template-update/1496

Conversation

@rails-template-sync

Copy link
Copy Markdown
Contributor

Template Update

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

Cherry-picked from mockdeep/Rails-Template#1496

Warning

Conflicts were automatically resolved by Claude. Please review these files carefully:

  • bin/build
  • bin/build_css

**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
mockdeep force-pushed the template-update/1496 branch from da96ffa to 6e52934 Compare September 20, 2026 18:37
@mockdeep
mockdeep merged commit 28d5f65 into main Sep 20, 2026
3 checks passed
@mockdeep
mockdeep deleted the template-update/1496 branch September 20, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant