开发者

Rails 3.1 obfuscate javascript

With Rails 3.1, the sprockets gem was introduced. I have written a very large game engine in javascript/coffeescript which I plan to release as ope开发者_如何学运维n source software in the future, but at the moment, I would like to obfuscate the code to build a small barrier for people trying to cheat in the game. My question is:

What do I have to do to create an obfuscated version of the application.js file which was created by combining all my js files? Is there a best practice, a gem or it is even possible at all?

Thanks for your answer.

Tom


You could try dojo's ShrinkSafe - it will minify/obfuscate yoour sources and you can configure it to generate one single file out of several input source files.


Well, you could use Closure Compiler with advanced optimization, although I would recommend against it:

http://edgeguides.rubyonrails.org/asset_pipeline.html#javascript

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜