Skip to content

Commit

Permalink
Added the ability to load via require
Browse files Browse the repository at this point in the history
Prior to this change, we had to use script tags to load
playground.js. Now, we can simply download playground using
npm, and use CommonJS' `require` to load the module.

This commit adds a `package.json` file for the sake of compatibility
with npm, a `.gitignore` file to ignore the `node_modules` folder,
enhances `plugins/playground.three.js` to be loadable via `require`
and enhances build.js to distribute a CommonJS-equivalent of the
build files.
  • Loading branch information
Salehen Shovon Rahman committed Jul 25, 2015
1 parent f2c600f commit 0194ddc
Show file tree
Hide file tree
Showing 6 changed files with 9,089 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions build.js
Expand Up @@ -62,4 +62,9 @@ for (var key in builds) {

output.to("build/" + key);

output = 'var PLAYGROUND;\n' + output;
output += '\nmodule.exports = playground;';
output += 'playground.Application = PLAYGROUND.Application;';
output.to("build/commonjs/" + key);

}

0 comments on commit 0194ddc

Please sign in to comment.