Rails 3.1 混淆 javascript
在 Rails 3.1 中,引入了 sprockets gem。我已经用 javascript/coffeescript 编写了一个非常大的游戏引擎,我计划将来作为开源软件发布,但目前,我想混淆代码,为试图在游戏中作弊的人建立一个小障碍。我的问题是:
我必须做什么才能创建通过组合所有 js 文件创建的 application.js 文件的混淆版本?是否有最佳实践、瑰宝或者甚至是可能的?
感谢您的回答。
汤姆
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 open 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以尝试 dojo 的 ShrinkSafe - 它会缩小/混淆你的源代码可以将其配置为从多个输入源文件中生成一个文件。
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.
好吧,您可以使用闭包编译器进行高级优化,尽管我建议不要这样做:
http://edgeguides .rubyonrails.org/asset_pipeline.html#javascript
Well, you could use Closure Compiler with advanced optimization, although I would recommend against it:
http://edgeguides.rubyonrails.org/asset_pipeline.html#javascript