Make all add-ons CommonJS importable
- Fix #52 - Rename `npm/nodejs project` documentation to `CommonJS environment`
This commit is contained in:
@@ -7,7 +7,12 @@
|
||||
*/
|
||||
|
||||
(function (attach) {
|
||||
if (typeof define == 'function') {
|
||||
if (typeof exports === 'object' && typeof module === 'object') {
|
||||
/*
|
||||
* CommonJS environment
|
||||
*/
|
||||
module.exports = attach.call(this);
|
||||
} else if (typeof define == 'function') {
|
||||
/*
|
||||
* Require.js is available
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user