Skip to content

Instantly share code, notes, and snippets.

@vinhlh
Last active May 6, 2017 15:57
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 vinhlh/6f128939405a99f4e5f5b559fdd89a94 to your computer and use it in GitHub Desktop.
Save vinhlh/6f128939405a99f4e5f5b559fdd89a94 to your computer and use it in GitHub Desktop.
(function(modules) {
// The module cache
var installedModules = {};
// The require function
function __webpack_require__(moduleId) {
// Check if module is in cache
if(installedModules[moduleId])
return installedModules[moduleId].exports;
// Create a new module (and put it into the cache)
var module = installedModules[moduleId] = {
exports: {},
id: moduleId,
loaded: false
};
// Execute the module function
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
// Flag the module as loaded
module.loaded = true;
// Return the exports of the module
return module.exports;
}
// expose the modules object (__webpack_modules__)
__webpack_require__.m = modules;
// expose the module cache
__webpack_require__.c = installedModules;
// Load entry module and return exports
return __webpack_require__(0);
})([
function(module, exports, __webpack_require__) {
function getDefaultRegistry() {
// an example function
}
exports.getDefaultRegistry = getDefaultRegistry;
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment