-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle sourceMappingURL already prefixed with asset path #170
Handle sourceMappingURL already prefixed with asset path #170
Conversation
This seems to be addressing the same problem as #150. Or is it something else? |
If it is, I'm more inclined with going with this solution, instead of allowing the regex to swallow everything that is not the asset name in a non capturing group. |
Yes it is |
Why did you close it? This seems like the better solution compared to #150 |
Reopened. I found a monkey patching solution to unblock me. |
in production environments the url_prefix may be proceeded by a cdn host, ensure that it is part of the capture group this change will require anything prior to the url_prefix to end in a forward slash test case
a70a6d9
to
83d58a8
Compare
Thanks! |
We're caught by this too - any ideas when the next cut of propshaft will be published? |
I'll ask, but for now you can simply change your Gemfile to point to the correct commit in the main (which is what the new gem would use) gem "propshaft", github: "rails/propshaft", ref: "8fb8f7c9cb63c16b381dad47b69a36fd67837985" Or if you prefer, point to gem "propshaft", github: "rails/propshaft", branch: "main" |
@brenogazzola thank you! We're not keen to run a version that isn't also being run by thousands of other people; would be great to have an indication of when an official cut is scheduled 🙏🏻 |
@brenogazzola any chance you managed to get an approximate release date? |
Would love to see this included in a release! |
When using a build system, specifically esbuild and referencing assets such as images, you must set a
publicPath
configuration. This allows assets to be fetched for the appropriate endpoint (eg.image.png
-->assets/image.png
) when rendering a page. In addition to images being called fromurl()
, setting thepublicPath
also sets the sourceMappingURL comment to the prefixed path. Because of this added prefix, Propshaft removes the sourceMappingURL comment from the minified JS asset as the path cannot be correctly resolved.This change will remove the prefix if the
source_mapping_url
prior to rewrite of the comment.