Closed ryanwilliams closed 12 years ago
Hi,
In my opinion CP shouldn't set the window.cp global if module.exports exists. i.e. If someone is using commonJS module system, they probably don't want the global being there and will instead 'require' in the lib as needed.
So the top should look something like:
var cp; if(typeof exports === 'undefined'){ cp = {}; if(typeof window === 'object'){ window.cp = cp; } } else { cp = exports; }
Good point. Fixed.
Hi,
In my opinion CP shouldn't set the window.cp global if module.exports exists. i.e. If someone is using commonJS module system, they probably don't want the global being there and will instead 'require' in the lib as needed.
So the top should look something like: