rails/propshaft

digested source maps

firien opened this issue · 4 comments

recently stumbled into this project while attempting a rails 7 update. I am using the predigested ".digested" method because my js files need to reference themselves, and am having 2 issues with the source maps.

  1. The sourceMappingURL is being striped away:
    Propshaft.logger.warn "Removed sourceMappingURL comment for missing asset '#{resolved_path}' from #{resolved_path}"
    (quick and dirty solution in dev mode is to call config.assets.compilers.pop to remove Propshaft::Compilers::SourceMappingUrls)
  2. Also the source maps will not be served without tweaking extract_path_and_digest - firien/propshaft@3903815...ed67507

Thanks for the report @firien. I will hold back a solution for this one for now, as it seems #100 was the one to break. As soon as I decide if it will be reverted or not, I'll fix this one.

Well I for one was excited to see #100 - we need something like this right?

It cleaned up some internal code and added a useful feature, which is why I’m holding back on reverting it. Still hoping we can find something that will satisfy all the use cases.

Fortunately Propshaft will only replace Sprockets as the default on Rails 8, so there’s time.

https://github.com/firien/propshaft/tree/esbuild has fixes and tests for 2 issues mentioned above