cocos2d-x JS project with modules using webpack

Hey,

Cocos2d-x Javascript project usually require you to pollute the global namespace with your scenes and layers . Using the AMD or CommonJS format would reduce this problem. Here’s an example project I created using cocos2dx Js and Webpack.

You can write your code in the source folder without polluting the global namespace (using require) and then run webpack to compile the files into the src folder which cocos picks up. Only two files are mentioned in project.json - bundle.js and vendor.js - for your source files and npm libraries respectively.

Nam