Skip to content

Commit

Permalink
Merge branch 'feature/commonjs-support' of https://github.com/saschag…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 18, 2014
2 parents 53c47e6 + 7b4d0af commit 3082dca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main(argv=None):
sources = []

if args.amd:
tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( factory );\n\n\t} else {\n\n\t\troot.THREE = factory();\n\n\t}\n\n}( this, function () {\n\n')
tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [\'exports\'], factory );\n\n\t} else if (typeof exports === \'object\') {\n\n\t\tfactory(exports);\n\n\t} else {\n\n\t\tfactory(root);\n\n\t}\n\n}( this, function (exports) {\n\n')

for include in args.include:
with open('includes/' + include + '.json','r') as f:
Expand All @@ -59,7 +59,7 @@ def main(argv=None):
tmp.write('\n')

if args.amd:
tmp.write('return THREE;\n\n} ) );')
tmp.write('exports.THREE = THREE;\n\n} ) );')

tmp.close()

Expand Down

0 comments on commit 3082dca

Please sign in to comment.