GoodBoyDigital/pixi.js — pull request #1015 by Qard (2014-10-04 23:06:12+00:00)
Title: Browserify conversion (fixed target)

> This is the fix of #1014 to point to the dev branch, rather than master.

I am working on converting the build process to use browserify, so eventually better modularization can be achieved.

I've looked through the previous attempts at https://github.com/drkibitz/node-pixi and https://github.com/pixijs, but found they suffered from being too radically divergent. Unlike those, I'm avoiding making radical changes to the codebase. I hope to be able to track upstream with minimal conflicts, allowing gradual conversion to occur.

Yes, this method is a little bit ugly for commonjs. But it allows the current code to work almost entirely unchanged while still splitting it up into unique modules in the browserify bundle. This should allow files to be converted to commonjs one at a time, rather than in one big rewrite.

I could use some feedback. Does this seem like a reasonable approach?

A possible next step to avoid the dependency in each file of a global "PIXI" variable being present would be to add var PIXI = require('path/to/module.js') at the top of each file. I've held off on that for now because it would break the existing build process, leaving browserify the only option. I want to get feedback before I continue.