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
Support for js source maps #438
Comments
I'm willing to implement it but I'd like to know if there's any interest about this feature. So far I've been reading the code to get an idea of what is needed to accomplish this. First, on the template tags side, there are at least two options to turn on source maps, a parameter for the compressor or a different compressor: Then, if source maps option is on, the compressor should check that all the hunks are files because you can't generate source maps for inline (I think, not completely sure). Finally, maybe the trickiest part, a compressor backend that can handle a list of files and output the compressed js and the source map file is needed. I'd love to get some feedback on this to know if I'm on track or I got everything wrong. |
This may be possible with the existing toolchain. I've managed to get basic sourceMapURL support for CSS via SASS. e.g. https://gist.github.com/Nagyman/6542739 This is very preliminary; some known limitations are mentioned in the comments. |
I am interested. It would easy fast debugging staging code. |
Yes, i'm currently working on this feature. |
@sicarrots I'm using source maps when |
I'm having some success experimenting with Compressor and uglify.js. For now I've subclassed the |
source maps are used by sentry too https://www.getsentry.com/docs/sourcemaps/ |
@fetzig Exactly my rationale behind doing that |
@Kos Would you kindly paste some code for inspiration purposes ? Thanks B) |
This is what I ended up using: https://gist.github.com/Kos/9270494 (I have offline compression on production and no compression in development) Next step would be to allow using edit: 🍻 :-) |
🍻 @Kos! |
+1 for that feature! |
For JS sourcemaps I found that: |
+1 I would like this feature also. It is very handy to be able to debug JS compressed files in production. Sentry errors do not make much sense if not. |
+1 for the feature, absolutely required for Sentry errors :) |
+1 for js and css source maps |
I would like to see js/ES6/coffee(even TypeScript) and css/sass/less source map |
Does Compress still not support source maps feature? |
No, it still does not support that feature. You're welcome to submit a PR implementing this. |
It's still possible to implement some "hackish" solution, for example: Better solution is required to make PR... |
Source maps are a very nice tool for debugging something on compressed code using Chrome Dev Tools. There are lots of tools that generate them including Google closure that is already supported by django-compressor.
Here's some info: https://github.com/ryanseddon/source-map/wiki/Source-maps%3A-languages,-tools-and-other-info
The text was updated successfully, but these errors were encountered: