Jump to content

Organizing a Phaser Typescript project


ABev
 Share

Recommended Posts

First of all, I apologize if this is not the correct place to ask this question, since maybe it's more of a Typescript question than a Phaser question?

 

I'm trying to create a typescript project that uses Phaser in the browser and talks to a Node.js server via socket.io.  My browser code is set up just like in the tutorial and it all compiles to one file - game.js.  Meanwhile, my server is compiling to commonjs modules.

 

I have some code that I would like to keep common between the Phaser side and the Node side, but I can't seem to create a module that both sides can use.  When I add an export = MyModule; to the end of a file, it won't let me use it in my game.  Removing the export seems to allow my game to use the module, but then Node can't load it....

 

Has anyone else run into this problem?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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