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.
129 lines (115 loc) • 3.88 kB
JavaScript
var library1 =
/******/ (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 */
/*!*****************************!*\
!*** ./~/library1/index.js ***!
\*****************************/
/***/ function(module, exports, __webpack_require__) {
// Single File library
var loadTimelibrary1 = typeof window.library1 === "undefined"
describe("library1", function() {
it("should load library1 only once", function() {
loadTimelibrary1.should.be.ok;
});
it("should load a component", function() {
__webpack_require__(/*! ./lib/component */ 1).should.be.eql("lib1 component");
});
it("should load async submodules with require.ensure even if single == true", function(done) {
var sameTick = true;
!/*require.ensure*/(function(require) {
sameTick.should.be.eql(true);
__webpack_require__(/*! submodule1 */ 3).should.be.eql("submodule1");
__webpack_require__(/*! submodule2 */ 4).should.be.eql("submodule2");
__webpack_require__(/*! submodule3 */ 2)().should.be.eql("submodule3");
!/*require.ensure*/(function(require) {
sameTick.should.be.eql(true);
done();
}(__webpack_require__));
}(__webpack_require__));
sameTick = false;
});
});
module.exports = true;
/***/ },
/* 1 */
/*!*************************************!*\
!*** ./~/library1/lib/component.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./comp.js */ 5);
/***/ },
/* 2 */
/*!*******************************!*\
!*** ./~/submodule3/index.js ***!
\*******************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = function() {
return "submodule3";
};
/***/ },
/* 3 */
/*!******************************************!*\
!*** ./~/library1/~/submodule1/index.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = "submodule1";
/***/ },
/* 4 */
/*!******************************************!*\
!*** ./~/library1/~/submodule2/index.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = (function() {
return "submodule2";
}());
/***/ },
/* 5 */
/*!********************************!*\
!*** ./~/library1/lib/comp.js ***!
\********************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = "lib1 component";
/***/ }
/******/ ])