Created
September 30, 2016 01:36
-
-
Save think2011/39d268ac41edb1497bd1dbe157b3367a to your computer and use it in GitHub Desktop.
umd define
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD | |
define([], factory) | |
} else if (typeof exports === 'object') { | |
// Node, CommonJS | |
module.exports = factory() | |
} else { | |
// Window | |
root.collisionChecker = factory() | |
} | |
}(this, function () { | |
function func() { | |
console.log('记得修改 Window 的导出') | |
} | |
return func | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment