(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) varmodule = 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 returnmodule.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); })([function(module, exports) { var chunk1=1; exports.chunk1=chunk1; }]);
(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) varmodule = 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 returnmodule.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); })([function (module, exports, __webpack_require__) { var chunk1=__webpack_require__(1); console.log(chunk1); }, function (module, exports) { var chunk1 = 1; exports.chunk1 = chunk1; }]);
不一样的地方就是自执行函数的参数由
1
[function(module, exports) { var chunk1=1; exports.chunk1=chunk1;}]
变为
1 2 3 4 5 6 7
[function (module, exports, __webpack_require__) { var chunk1=__webpack_require__(1); console.log(chunk1); }, function (module, exports) { var chunk1 = 1; exports.chunk1 = chunk1; }]
(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) varmodule = 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 returnmodule.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); })([function (module, exports, __webpack_require__) {
var chunk1 = __webpack_require__(1); var chunk2 = __webpack_require__(2); console.log(chunk1); console.log(chunk2); }, function (module, exports, __webpack_require__) {
__webpack_require__(2); var chunk1 = 1; exports.chunk1 = chunk1; }, function (module, exports) {
(function (modules) { // webpackBootstrap // install a JSONP callback for chunk loading var parentJsonpFunction = window["webpackJsonp"]; window["webpackJsonp"] = functionwebpackJsonpCallback(chunkIds, moreModules) { // add "moreModules" to the modules object, // then flag all "chunkIds" as loaded and fire callback var moduleId, chunkId, i = 0, callbacks = []; for (; i < chunkIds.length; i++) { chunkId = chunkIds[i]; if (installedChunks[chunkId]) callbacks.push.apply(callbacks, installedChunks[chunkId]); installedChunks[chunkId] = 0; } for (moduleId in moreModules) { modules[moduleId] = moreModules[moduleId]; } if (parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); while (callbacks.length) callbacks.shift().call(null, __webpack_require__); if (moreModules[0]) { installedModules[0] = 0; return __webpack_require__(0); } }; // The module cache var installedModules = {}; // object to store loaded and loading chunks // "0" means "already loaded" // Array means "loading", array contains callbacks var installedChunks = { 2: 0 }; // 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) varmodule = 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 returnmodule.exports; } // This file contains only the entry chunk. // The chunk loading function for additional chunks __webpack_require__.e = functionrequireEnsure(chunkId, callback) { // "0" is the signal for "already loaded" if (installedChunks[chunkId] === 0) return callback.call(null, __webpack_require__); // an array means "currently loading". if (installedChunks[chunkId] !== undefined) { installedChunks[chunkId].push(callback); } else { // start chunk loading installedChunks[chunkId] = [callback]; var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.charset = 'utf-8'; script.async = true; script.src = __webpack_require__.p + "" + chunkId + "." + ({ "0": "main", "1": "main1" }[chunkId] || chunkId) + ".js"; head.appendChild(script); } }; // expose the modules object (__webpack_modules__) __webpack_require__.m = modules; // expose the module cache __webpack_require__.c = installedModules; // __webpack_public_path__ __webpack_require__.p = ""; })([, function (module, exports) {
var chunk1=__webpack_require__(1); var chunk2=__webpack_require__(2); exports.a=1; console.log(chunk1); },function(module, exports) { var chunk1=1; exports.chunk1=chunk1; },function(module, exports) { var chunk2=1; exports.chunk2=chunk2; }]);
/******/ (function(modules) { // webpackBootstrap /******/// install a JSONP callback for chunk loading /******/var parentJsonpFunction = window["webpackJsonp"]; /******/window["webpackJsonp"] = functionwebpackJsonpCallback(chunkIds, moreModules) { /******/// add "moreModules" to the modules object, /******/// then flag all "chunkIds" as loaded and fire callback /******/var moduleId, chunkId, i = 0, callbacks = []; /******/for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/if(installedChunks[chunkId]) /******/ callbacks.push.apply(callbacks, installedChunks[chunkId]); /******/ installedChunks[chunkId] = 0; /******/ } /******/for(moduleId in moreModules) { /******/ modules[moduleId] = moreModules[moduleId]; /******/ } /******/if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); /******/while(callbacks.length) /******/ callbacks.shift().call(null, __webpack_require__);
/******/ };
/******/// The module cache /******/var installedModules = {};
/******/// object to store loaded and loading chunks /******/// "0" means "already loaded" /******/// Array means "loading", array contains callbacks /******/var installedChunks = { /******/0:0 /******/ };
/******/// 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) /******/varmodule = 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 /******/returnmodule.exports; /******/ }
/******/// This file contains only the entry chunk. /******/// The chunk loading function for additional chunks /******/ __webpack_require__.e = functionrequireEnsure(chunkId, callback) { /******/// "0" is the signal for "already loaded" /******/if(installedChunks[chunkId] === 0) /******/return callback.call(null, __webpack_require__);
/******/// This file contains only the entry chunk. /******/// The chunk loading function for additional chunks /******/ __webpack_require__.e = functionrequireEnsure(chunkId, callback) { /******/// "0" is the signal for "already loaded" /******/if(installedChunks[chunkId] === 0) /******/return callback.call(null, __webpack_require__);
/******/// This file contains only the entry chunk. /******/// The chunk loading function for additional chunks /******/ __webpack_require__.e = functionrequireEnsure(chunkId, callback) { //installedChunks[1]为undefined /******/// "0" is the signal for "already loaded" /******/if(installedChunks[chunkId] === 0) /******/return callback.call(null, __webpack_require__);