简体   繁体   中英

Coffee source maps on staging (uglified)

Is there any way to get source maps for uglified JS in Rails 3?

I am currently using code from https://github.com/markbates/coffee-rails-source-maps and that works great for development, but after turning on assets precompilation and (most importantly) uglifying and turning debug assets off, it won't work (since it's not designed to).

Uglifier seems to support source maps, and the new coffee-script-source supports source maps also. I've tried hacking around sprockets a bit but I wasn't able to find a solution.

So basically what I have is *.coffee -> *.js -> application.js (uglified), I want to at least get back to the javascript source (un-unglified), but ideally of course to get back to the coffeescript.

Is this possible in Rails 3? With any monkey-patching or anything that is necessary.

Indeed, there is some ongoing work to make this all work together with the asset pipeline, but it's not done yet. See this pull request for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM