Permalink
Browse files

Handle loading classes in browser

  • Loading branch information...
1 parent f944a41 commit 56186475b73d0d3beb2563020b0bac2d8d2bd82f @joelvh committed Dec 3, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/json2json.coffee
View
@@ -1,3 +1,6 @@
-exports.ObjectTemplate = require './ObjectTemplate'
-exports.TemplateConfig = require './TemplateConfig'
+# load modules in CommonJS/Node.js environment, not needed in browser
+
+if exports? && require?
+ exports.ObjectTemplate = require './ObjectTemplate'
+ exports.TemplateConfig = require './TemplateConfig'

0 comments on commit 5618647

Please sign in to comment.