Skip to content

Instantly share code, notes, and snippets.

@think2011
Created September 30, 2016 01:36
Show Gist options
  • Save think2011/39d268ac41edb1497bd1dbe157b3367a to your computer and use it in GitHub Desktop.
Save think2011/39d268ac41edb1497bd1dbe157b3367a to your computer and use it in GitHub Desktop.
umd define
;(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