-
Notifications
You must be signed in to change notification settings - Fork 791
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
Sourcemap doesn't work by default #783
Comments
in development + config.assets.debug = true source maps should work, but they won't be exported. autogeneration for production use was never implemented in sprockets. You have to use static sourcemaps or generate them on your own with some hackery like #410 (comment) (untested and outdated)... |
Thanks. This is kinda surprising and I was totally expecting it to work given the current documentation. I know it suggests that it's for development workflow, but you may want to spell that one out :-) I'll check out the custom uglifier and report back if that's still valid for rails 6+ |
I can confirm this behaviour in development with 4.2.0. It works with 4.1.1 |
Back later, but the custom uglifier does not work OOTB in rails 6. It's beyond trivial changes so didn't spend too much time on it. It would be nice if there was a simple way to do it in production automatically. |
In case it is still needed here is a gem to do that using terser sprockets_terser_with_source_maps |
I was hoping to use the sourcemaps after upgrading to sprockets v4. Unfortunately they're not generated.
Originally I was using uglifier, but switched to the recommended
:terser
option.I'm running sprockets through rails 6.1 with config:
and running the
assets:precompile
job to trigger sprockets.System configuration
Example App (Reproduction) - THIS IS IMPORTANT YOUR ISSUE LIKELY WILL NOT BE RESOLVED WITHOUT THIS
https://github.com/viraptor/sprockets-no-map-example/commits/master
3 commits:
terser
gemAfter running
RAILS_ENV=production bundle exec rails assets:precompile
I get only these files - no maps generated:The text was updated successfully, but these errors were encountered: