UNPKG

webpack

Version:

Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.

95 lines (91 loc) 3.64 kB
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // object to store loaded chunks /******/ // "1" means "already loaded" /******/ var installedChunks = { /******/ 0:1 /******/ }; /******/ /******/ // 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; /******/ } /******/ /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __webpack_require__.e = function requireEnsure(chunkId, callback) { /******/ if(installedChunks[chunkId] === 1) callback.call(null, __webpack_require__); /******/ else if(!installedChunks[chunkId]) { /******/ installedChunks[chunkId] = [callback]; /******/ var filename = __dirname + "/" + chunkId + ".bundle.js"; /******/ require('fs').readFile(filename, 'utf-8', function(err, content) { /******/ if(err) { if(__webpack_require__.onError) return __webpack_require__.onError(err); else throw err; } /******/ var chunk = {}; /******/ require('vm').runInThisContext('(function(exports, require, __dirname, __filename) {' + content + '\n})', filename)(chunk, require, require('path').dirname(filename), filename); /******/ var moreModules = chunk.modules, chunkIds = chunk.ids; /******/ for(var moduleId in moreModules) { /******/ modules[moduleId] = moreModules[moduleId]; /******/ } /******/ var callbacks = []; /******/ for(var i = 0; i < chunkIds.length; i++) { /******/ if(Array.isArray(installedChunks[chunkIds[i]])) /******/ callbacks = callbacks.concat(installedChunks[chunkIds[i]]); /******/ installedChunks[chunkIds[i]] = 1; /******/ } /******/ for(i = 0; i < callbacks.length; i++) /******/ callbacks[i].call(null, __webpack_require__); /******/ }); /******/ } else installedChunks[chunkId].push(callback); /******/ }; /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /*!*********************************!*\ !*** ./chunks/context/index.js ***! \*********************************/ /***/ function(module, exports, __webpack_require__) { it("should also work in a chunk", function(done) { __webpack_require__.e/*nsure*/(1, function(require) { var contextRequire = __webpack_require__(/*! . */ 1); contextRequire("./two").should.be.eql(2); var tw = "tw"; __webpack_require__(/*! . */ 2)("./" + tw + "o").should.be.eql(2); done(); }); }); /***/ } /******/ ])