Hi plugin developers,
Just a heads up - we're getting bug reports that projects don't work after exporting with minifying enabled. I'm pretty sure this is because of third party plugins.
The minifier renames object properties. If you mix object.prop and object["prop"] syntax your plugin will probably break the project on export. From the SDK documentation:
hen exporting, Construct 2 gives the user the option to 'Minify script'. This runs the common and runtime scripts through Google Closure Compiler's ADVANCED_OPTIMIZATIONS mode. This imposes some limitations on what scripts can do. You must obey these limitations when writing your plugins, otherwise your plugin will be broken on export. More details can be found here (http://code.google.com/closure/compiler/docs/api-tutorial3.html).
The main thing is to always use dot syntax (Object.property) rather than bracket syntax (Object["property"]). All properties using dot syntax are changed by Closure Compiler, but none of the properties in bracket syntax are changed. Therefore, if you use Object.property in one place and Object["property"] in another to access the same property, the plugin will be broken on export. You may still use bracket syntax (e.g. for a dictionary of user-inputted strings) - just be aware of how Closure Compiler will transform the code.
Remember the edittime scripts are not passed through Google Closure Compiler, so you can write them how you like.
Please double check all your plugins correctly minify on export! And don't forget to read the documentation! <img src="smileys/smiley1.gif" border="0" align="middle">