سؤال

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

هل كانت مفيدة؟

المحلول

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

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

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top