Skip to content

Instantly share code, notes, and snippets.

@gracefullight
Created December 22, 2016 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gracefullight/6e84e686cf119dadb99fefdeb258c6d0 to your computer and use it in GitHub Desktop.
Save gracefullight/6e84e686cf119dadb99fefdeb258c6d0 to your computer and use it in GitHub Desktop.
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
// AMD 환경
define(['exports', 'jquery'], factory);
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
// CommonJS 환경
factory(exports, require('jquery'));
} else {
// 일반 브라우저
factory((global.module1 = global.module1 || {}), global.$);
}
}(this, function (exports, $) {
// module1의 private 기능 구현
// exports에 public function을 붙혀주면 된다.
exports.action = function () {};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment