rails / cssbundling-rails

Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
MIT License
579 stars 83 forks source link

Precompile url() with prefix #94

Closed brianlow closed 8 months ago

brianlow commented 2 years ago

I'd like

src: url("./fonts/icons.woff2");

to precompile to:

src: url("/myapp1/assets/fonts/icons.woff2");
          ^^^^^^^

We use a shared asset host so the full path includes the application name: assets.example.com/myapp1.

With webpacker we used the publicPath option to add the prefix. Is there an equivalent?

ASSET_HOST seems to assume a fully qualified url. We'd prefer to avoid host names (e.g. assets-staging.example.com) in our compiled assets so we can use the same docker image across environments.

dhh commented 8 months ago

This would be something for Sprockets or Propshaft to consider.