AFrameJS is Now Compatible with Node.js/CommonJS

Today I did some initial work in making AFrameJS compatible with the CommonJS module format, which means AFrame can now be imported into node.js!

Since using AFrameJS on the server isn't going to involve DOM manipulation (generally speaking), a special build has been added to the GitHub repository's dist directory - the build removes all classes that deal with the DOM - things like Fields, Lists, and any of their related classes.

To use AFrameJS inside of your node.js project, download a build for node and place the file in your apps directory. I renamed the file to "aframe.js" from whatever the long name I downloaded.

Next, in your startup code:

   var AFrame = require( 'aframe' );

   // Use AFrame here.
   var MyClass = AFrame.Class( { /* class definition */ } );
   var myClassInst = AFrame.create( MyClass );

Sweet.