How to minimize source codes while using Phaser?

Hi,

If I wrote a game with Phaser, and want to protect source codes from easy copying, an option should be using some tools to minimize the codes.

I did a test with Closure Compiler by Google. After minimizing my codes, the game does not work anymore. I think this was because some variable names related to Phaser have been changed, so it would not communicate with Phaser anymore.

Is there a way to minimize the codes at Phaser environments, while keeping all working?

2 Likes

Thanks Samme. I will try it out.

this is a starter kit I’ve create for learning phaser based on snowpack

you can run

npm run build