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.

334 lines (295 loc) 10.7 kB
/******/ (function(modules) { // webpackBootstrap /******/ // 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; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /*!**********************************!*\ !*** ./parsing/context/index.js ***! \**********************************/ /***/ function(module, exports, __webpack_require__) { var require;var require;it("should be able to load a file with the require.context method", function() { __webpack_require__(/*! ./templates */ 1)("./tmpl").should.be.eql("test template"); (__webpack_require__(/*! ./././templates */ 1))("./tmpl").should.be.eql("test template"); (__webpack_require__(/*! ././templates/. */ 1)("./tmpl")).should.be.eql("test template"); __webpack_require__(/*! ././templates */ 1) ( "./subdir/tmpl.js" ).should.be.eql("subdir test template"); __webpack_require__(/*! ./templates */ 2)("xyz").should.be.eql("xyz"); }); it("should automatically create contexts", function() { var template = "tmpl", templateFull = "./tmpl.js"; var mp = "mp", tmp = "tmp", mpl = "mpl"; __webpack_require__(/*! ./templates */ 1)("./" + template).should.be.eql("test template"); __webpack_require__(/*! ./templates */ 3)("./" + tmp + "l").should.be.eql("test template"); __webpack_require__(/*! ./templates */ 4)("./t" + mpl).should.be.eql("test template"); __webpack_require__(/*! ./templates */ 5)("./t" + mp + "l").should.be.eql("test template"); __webpack_require__(/*! ./templates/templateLoader */ 8)(templateFull).should.be.eql("test template"); __webpack_require__(/*! ./templates/templateLoaderIndirect */ 9)(templateFull).should.be.eql("test template"); }); it("should be able to require.resolve with automatical context", function() { var template = "tmpl"; /*require.resolve*/(__webpack_require__(/*! ./templates */ 1).resolve("./" + template)).should.be.eql(/*require.resolve*/(/*! ./templates/tmpl */ 10)); }); it("should be able to use renaming combined with a context", function() { var renamedRequire = require; require = function () {}; require("fail"); var template = "tmpl"; __webpack_require__(/*! ./templates */ 1)("./" + template).should.be.eql("test template"); }); it("should compile an empty context", function() { var x = ""; (function() { !(function webpackMissingModule() { var e = new Error("Cannot find module \"./templates\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); }).toString().should.not.match(/require/); }); it("should execute an empty context", function() { var context; (function() { context = __webpack_require__(/*! ./templates/ */ 7); }).should.not.throw(); (function() { context(""); }).should.throw(); }); /***/ }, /* 1 */ /*!********************************************!*\ !*** ./parsing/context/templates ^\.\/.*$ ***! \********************************************/ /***/ function(module, exports, __webpack_require__) { var map = { "./subdir/tmpl": 12, "./subdir/tmpl.js": 12, "./templateLoader": 8, "./templateLoader.js": 8, "./templateLoaderIndirect": 9, "./templateLoaderIndirect.js": 9, "./tmpl": 10, "./tmpl.js": 10 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 1; /***/ }, /* 2 */ /*!*************************************!*\ !*** ./parsing/context/templates . ***! \*************************************/ /***/ function(module, exports, __webpack_require__) { var map = { "./subdir/tmpl": 12, "./subdir/tmpl.js": 12, "./templateLoader": 8, "./templateLoader.js": 8, "./templateLoaderIndirect": 9, "./templateLoaderIndirect.js": 9, "./tmpl": 10, "./tmpl.js": 10, "xyz": 13, "xyz.js": 13 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 2; /***/ }, /* 3 */ /*!*********************************************!*\ !*** ./parsing/context/templates ^\.\/.*l$ ***! \*********************************************/ /***/ function(module, exports, __webpack_require__) { var map = { "./subdir/tmpl": 12, "./tmpl": 10 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 3; /***/ }, /* 4 */ /*!*********************************************!*\ !*** ./parsing/context/templates ^\.\/t.*$ ***! \*********************************************/ /***/ function(module, exports, __webpack_require__) { var map = { "./templateLoader": 8, "./templateLoader.js": 8, "./templateLoaderIndirect": 9, "./templateLoaderIndirect.js": 9, "./tmpl": 10, "./tmpl.js": 10 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 4; /***/ }, /* 5 */ /*!**********************************************!*\ !*** ./parsing/context/templates ^\.\/t.*l$ ***! \**********************************************/ /***/ function(module, exports, __webpack_require__) { var map = { "./tmpl": 10 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 5; /***/ }, /* 6 */ /*!*******************************************************!*\ !*** ./parsing/context/templates ^\.\/notExisting.*$ ***! \*******************************************************/ /***/ function(module, exports, __webpack_require__) { function webpackContext(req) { throw new Error("Cannot find module '" + req + "'."); } webpackContext.resolve = webpackContext; webpackContext.keys = function() { return []; }; module.exports = webpackContext; /***/ }, /* 7 */ /*!****************************************************!*\ !*** ./parsing/context/templates ^\.\/notExisting ***! \****************************************************/ /***/ function(module, exports, __webpack_require__) { function webpackContext(req) { throw new Error("Cannot find module '" + req + "'."); } webpackContext.resolve = webpackContext; webpackContext.keys = function() { return []; }; module.exports = webpackContext; /***/ }, /* 8 */ /*!*****************************************************!*\ !*** ./parsing/context/templates/templateLoader.js ***! \*****************************************************/ /***/ function(module, exports, __webpack_require__) { module.exports = function(name) { return __webpack_require__(/*! . */ 1)(name); } /***/ }, /* 9 */ /*!*************************************************************!*\ !*** ./parsing/context/templates/templateLoaderIndirect.js ***! \*************************************************************/ /***/ function(module, exports, __webpack_require__) { var require;module.exports = function(name) { var a = load(__webpack_require__(/*! . */ 1), name); var r = require; var b = __webpack_require__(/*! . */ 1)(name); if(a !== b) return "FAIL"; return a; } function load(requireFunction, name) { return requireFunction(name); } /***/ }, /* 10 */ /*!*******************************************!*\ !*** ./parsing/context/templates/tmpl.js ***! \*******************************************/ /***/ function(module, exports, __webpack_require__) { module.exports = "test template"; /***/ }, /* 11 */, /* 12 */ /*!**************************************************!*\ !*** ./parsing/context/templates/subdir/tmpl.js ***! \**************************************************/ /***/ function(module, exports, __webpack_require__) { module.exports = "subdir test template"; /***/ }, /* 13 */ /*!********************************************!*\ !*** ./parsing/context/templates/~/xyz.js ***! \********************************************/ /***/ function(module, exports, __webpack_require__) { module.exports = "xyz"; /***/ } /******/ ]) /* //@ sourceMappingURL=bundle.js.map //# sourceMappingURL=bundle.js.map */