Jump to content

Google Closure Compiler


matias_ini
 Share

Recommended Posts

Hi, I am trying to minimize a Phaser project using Google Closure Compiler.

I have no problems using SIMPLE_OPTIMIZATIONS as it does not change the name of the functions and properties but if I try to use ADVANCED_OPTIMIZATIONS the code does not work.

I know that to solve it you have to use a file with the externs, but how exactly do I assemble this file so as not to have conflicts with all the functions and properties of Phaser?

Of this simple code:

var GamePlayManager = {
    init: function() {
        console.log("init");
    },
    preload: function() {
        console.log("preload");
    },
    create: function() {
        console.log("create");
    },
    update: function() {
        console.log("update");
    }
}

var game = new Phaser.Game(1136, 640, Phaser.CANVAS);
    
game.state.add("gameplay", GamePlayManager);
game.state.start("gameplay");

I get this:

var a=new Phaser.b(1136,640,Phaser.a);a.state.add("gameplay",{c:function(){console.log("init")},preload:function(){console.log("preload")},create:function(){console.log("create")},update:function(){console.log("update")}});a.state.start("gameplay");

When creating the Phaser project you see Phaser.b instead of Phaser.Game.

There are many functions and properties in Phaser so it would be impossible to put all in the extern file by hand unless it is already created by someone?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...