Jump to content

Browserify and Phaser


j0hnskot
 Share

Recommended Posts

Hello there! My source code starts to get a little messy and i decided to use browserify. I'm having some trouble to understand how i can achieve that.

Is there a tutorial on how to setup a project with the proper structure? Also, does someone got a template i can take a look on to understand how it works?

Link to comment
Share on other sites

Hi, after trying out a number of build tools, my favourite is brunch.  It uses commonJS style modules (like browserify), and offers many other build/automation options, like file watching, code compiling (coffeescript, sass, etc), running tests, browser live reload, etc.)  It is also faster than grunt and browswerify I think.

 

In a nutshell, you put your vendor files (like phaser) in /vendor, your static assets in app/assets, and your source code in app/.  It all gets built to public/.  You can also use bower instead of vendor/ if you like.

 

Here is one of my current games in progress using brunch: https://github.com/jschomay/color-blocks-blitz.  Note the directory structure, and in particular, the package.json and brunch-config.coffee files.

 

You'll need node/npm installed to get brunch, see the website for details.

 

Good luck, hope that helps.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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