2017-05-13 23:29:55 +08:00
This example shows how to create an explicit vendor chunk as well as a common chunk for code shared among entry points. In this example, we have 3 entry points: `pageA` , `pageB` , and `pageC` . Those entry points share some of the same utility modules, but not others. This configuration will pull out any modules common to at least 2 bundles and place it in the `common` bundle instead, all while keeping the specified vendor libraries in their own bundle by themselves.
2016-01-04 11:07:08 +08:00
To better understand, here are the entry points and which utility modules they depend on:
- `pageA`
2017-04-18 02:03:09 +08:00
- `utility1`
- `utility2`
2016-01-04 11:07:08 +08:00
- `pageB`
2017-04-18 02:03:09 +08:00
- `utility2`
- `utility3`
2016-01-04 11:07:08 +08:00
- `pageC`
2017-04-18 02:03:09 +08:00
- `utility2`
- `utility3`
2016-01-04 11:07:08 +08:00
Given this configuration, webpack will produce the following bundles:
- `vendor`
2017-04-18 02:03:09 +08:00
- webpack runtime
- `vendor1`
- `vendor2`
2016-01-04 11:07:08 +08:00
- `common`
2017-04-18 02:03:09 +08:00
- `utility2`
- `utility3`
2016-01-04 11:07:08 +08:00
- `pageA`
2017-04-18 02:03:09 +08:00
- `pageA`
- `utility1`
2016-01-04 11:07:08 +08:00
- `pageB`
2017-04-18 02:03:09 +08:00
- `pageB`
2016-01-04 11:07:08 +08:00
- `pageC`
2017-04-18 02:03:09 +08:00
- `pageC`
2016-01-04 11:07:08 +08:00
With this bundle configuration, you would load your third party libraries, then your common application code, then your page-specific application code.
# webpack.config.js
``` javascript
var path = require("path");
module.exports = {
2017-12-14 17:58:03 +08:00
// mode: "development" || "production",
2016-01-04 11:07:08 +08:00
entry: {
pageA: "./pageA",
pageB: "./pageB",
pageC: "./pageC"
2018-01-20 00:06:59 +08:00
},
optimization: {
2018-12-19 21:05:17 +08:00
chunkIds: "named",
2018-01-20 00:06:59 +08:00
splitChunks: {
cacheGroups: {
2018-01-22 22:18:54 +08:00
commons: {
chunks: "initial",
minChunks: 2,
2018-02-17 21:14:14 +08:00
maxInitialRequests: 5, // The default limit is too small to showcase the effect
2018-01-22 22:18:54 +08:00
minSize: 0 // This is example is too small to create commons chunks
},
2018-01-20 00:06:59 +08:00
vendor: {
test: /node_modules/,
2018-01-22 22:18:54 +08:00
chunks: "initial",
2018-01-20 00:06:59 +08:00
name: "vendor",
2018-02-17 21:14:14 +08:00
priority: 10,
2018-01-20 00:06:59 +08:00
enforce: true
}
}
}
2016-01-04 11:07:08 +08:00
},
output: {
2018-01-05 04:39:29 +08:00
path: path.join(__dirname, "dist"),
2016-01-04 11:07:08 +08:00
filename: "[name].js"
2018-01-20 00:06:59 +08:00
}
2016-01-04 11:07:08 +08:00
};
```
2018-01-05 04:39:29 +08:00
# dist/vendor.js
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
``` javascript
2018-12-19 21:05:17 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendor"],{
2018-01-20 00:06:59 +08:00
/***/ 1:
/*!*********************************!*\
!*** ./node_modules/vendor1.js ** *!
\*********************************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: module */
/***/ (function(module) {
2018-01-20 00:06:59 +08:00
module.exports = "vendor1";
/***/ }),
/***/ 5:
/*!*********************************!*\
!*** ./node_modules/vendor2.js ** *!
\*********************************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: module */
/***/ (function(module) {
2018-01-20 00:06:59 +08:00
module.exports = "vendor2";
/***/ })
}]);
```
2018-12-19 21:05:17 +08:00
# dist/commons-utility2_js.js
2018-01-20 00:06:59 +08:00
``` javascript
2018-12-19 21:05:17 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["commons-utility2_js"],{
2018-01-20 00:06:59 +08:00
/***/ 3:
/*!*********************!*\
!*** ./utility2.js ** *!
\*********************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: module */
/***/ (function(module) {
2018-01-20 00:06:59 +08:00
module.exports = "utility2";
2018-01-22 22:18:54 +08:00
/***/ })
}]);
```
2018-12-19 21:05:17 +08:00
# dist/commons-utility3_js.js
2018-01-22 22:18:54 +08:00
``` javascript
2018-12-19 21:05:17 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["commons-utility3_js"],{
2018-01-20 00:06:59 +08:00
/***/ 6:
/*!*********************!*\
!*** ./utility3.js ** *!
\*********************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: module */
/***/ (function(module) {
2018-01-20 00:06:59 +08:00
module.exports = "utility3";
/***/ })
}]);
```
# dist/pageA.js
2017-03-31 02:42:42 +08:00
< details > < summary > < code > /******/ (function(modules) { /* webpackBootstrap */ })< / code > < / summary >
2016-01-04 11:07:08 +08:00
``` javascript
2018-12-19 21:05:17 +08:00
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
2016-01-04 11:07:08 +08:00
/******/ // The module cache
/******/ var installedModules = {};
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // The require function
/******/ function __webpack_require__ (moduleId) {
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // Check if module is in cache
2017-05-23 04:45:18 +08:00
/******/ if(installedModules[moduleId]) {
2016-01-04 11:07:08 +08:00
/******/ return installedModules[moduleId].exports;
2017-05-23 04:45:18 +08:00
/******/ }
2016-01-04 11:07:08 +08:00
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
2016-06-06 02:51:44 +08:00
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
2016-01-04 11:07:08 +08:00
/******/ };
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__ );
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // Flag the module as loaded
2016-06-06 02:51:44 +08:00
/******/ module.l = true;
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
2017-03-31 02:25:01 +08:00
/******/
/******/
2016-01-04 11:07:08 +08:00
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__ .m = modules;
2017-03-31 02:25:01 +08:00
/******/
/******/
2018-12-19 21:05:17 +08:00
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
2017-03-31 02:25:01 +08:00
/******/
2019-02-05 01:52:39 +08:00
/******/ // run startup
2018-12-19 21:05:17 +08:00
/******/ return __webpack_require__ .x();
2016-01-04 11:07:08 +08:00
/******/ })
/************************************************************************/
2016-09-07 18:28:56 +08:00
```
2017-03-31 02:42:42 +08:00
2016-09-07 18:28:56 +08:00
< / details >
2017-03-31 02:42:42 +08:00
2016-09-07 18:28:56 +08:00
``` javascript
2017-06-05 22:12:12 +08:00
/******/ ([
2017-12-14 17:58:03 +08:00
/* 0 */
2016-01-04 11:07:08 +08:00
/*!******************!*\
!*** ./pageA.js ** *!
\******************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
/*! runtime requirements: __webpack_require__module, */
2018-12-19 21:05:17 +08:00
/***/ (function(module, __unusedexports, __webpack_require__ ) {
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
var vendor1 = __webpack_require__ (/*! vendor1 */ 1);
var utility1 = __webpack_require__ (/*! ./utility1 */ 2);
var utility2 = __webpack_require__ (/*! ./utility2 */ 3);
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "pageA";
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
2017-06-05 22:12:12 +08:00
/***/ }),
2018-01-20 00:06:59 +08:00
/* 1 */,
/* 2 */
2017-06-05 22:12:12 +08:00
/*!*********************!*\
!*** ./utility1.js ** *!
\*********************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: module */
/***/ (function(module) {
2017-06-05 22:12:12 +08:00
module.exports = "utility1";
2017-03-31 02:25:01 +08:00
/***/ })
2018-12-19 21:05:17 +08:00
/******/ ],
2016-01-04 11:07:08 +08:00
```
2018-12-19 21:05:17 +08:00
< details > < summary > < code > function(__webpack_require__) { /* webpackRuntimeModules */ });< / code > < / summary >
``` js
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ !function() {
/******/
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "pageA": 0
/******/ };
/******/
/******/ var deferredModules = [
/******/ [0,"vendor","commons-utility2_js"]
/******/ ];
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ var checkDeferredModules = function() {};
/******/ function checkDeferredModulesImpl() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
/******/ }
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ return result;
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ __webpack_require__ .x = function() {
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
/******/ };
/******/
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/ var runtime = data[3];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length ; i + + ) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ __webpack_require__ .m[moduleId] = moreModules[moduleId];
/******/ }
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ if(runtime) runtime(__webpack_require__);
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length ; i + + ) webpackJsonpCallback ( jsonpArray [ i ] ) ;
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/ }();
/******/
/******/ }
);
```
< / details >
# dist/pageB.js
``` javascript
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
2018-01-20 00:06:59 +08:00
/******/ // 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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__ );
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__ .m = modules;
/******/
/******/
2018-12-19 21:05:17 +08:00
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
2018-09-25 23:08:35 +08:00
/******/
2019-02-05 01:52:39 +08:00
/******/ // run startup
2018-12-19 21:05:17 +08:00
/******/ return __webpack_require__ .x();
2018-01-20 00:06:59 +08:00
/******/ })
/************************************************************************/
/******/ ({
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
/***/ 4:
2016-01-04 11:07:08 +08:00
/*!******************!*\
!*** ./pageB.js ** *!
\******************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
/*! runtime requirements: __webpack_require__module, */
2018-12-19 21:05:17 +08:00
/***/ (function(module, __unusedexports, __webpack_require__ ) {
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
var vendor2 = __webpack_require__ (/*! vendor2 */ 5);
var utility2 = __webpack_require__ (/*! ./utility2 */ 3);
var utility3 = __webpack_require__ (/*! ./utility3 */ 6);
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "pageB";
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
2017-03-31 02:25:01 +08:00
/***/ })
2016-01-04 11:07:08 +08:00
2018-12-19 21:05:17 +08:00
/******/ },
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ !function() {
/******/
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "pageB": 0
/******/ };
/******/
/******/ var deferredModules = [
/******/ [4,"vendor","commons-utility2_js","commons-utility3_js"]
/******/ ];
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ var checkDeferredModules = function() {};
/******/ function checkDeferredModulesImpl() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
/******/ }
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ return result;
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ __webpack_require__ .x = function() {
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
/******/ };
/******/
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/ var runtime = data[3];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length ; i + + ) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ __webpack_require__ .m[moduleId] = moreModules[moduleId];
/******/ }
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/ if(runtime) runtime(__webpack_require__);
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
2018-01-20 00:06:59 +08:00
/******/ }
2018-12-19 21:05:17 +08:00
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length ; i + + ) webpackJsonpCallback ( jsonpArray [ i ] ) ;
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/ }();
/******/
/******/ }
);
```
# dist/pageC.js
``` javascript
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
2018-01-20 00:06:59 +08:00
/******/ // 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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__ );
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__ .m = modules;
/******/
/******/
2018-12-19 21:05:17 +08:00
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
2018-01-20 00:06:59 +08:00
/******/
2019-02-05 01:52:39 +08:00
/******/ // run startup
2018-12-19 21:05:17 +08:00
/******/ return __webpack_require__ .x();
2018-01-20 00:06:59 +08:00
/******/ })
/************************************************************************/
/******/ ({
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
/***/ 7:
2016-01-04 11:07:08 +08:00
/*!******************!*\
!*** ./pageC.js ** *!
\******************/
2019-02-05 01:52:39 +08:00
/*! other exports [maybe provided (runtime-defined)] [no usage info] */
/*! runtime requirements: __webpack_require__module, */
2018-12-19 21:05:17 +08:00
/***/ (function(module, __unusedexports, __webpack_require__ ) {
2016-01-04 11:07:08 +08:00
2018-01-20 00:06:59 +08:00
var utility2 = __webpack_require__ (/*! ./utility2 */ 3);
var utility3 = __webpack_require__ (/*! ./utility3 */ 6);
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "pageC";
2016-01-04 11:07:08 +08:00
2017-03-31 02:25:01 +08:00
/***/ })
2016-01-04 11:07:08 +08:00
2018-12-19 21:05:17 +08:00
/******/ },
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ !function() {
/******/
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "pageC": 0
/******/ };
/******/
/******/ var deferredModules = [
/******/ [7,"commons-utility2_js","commons-utility3_js"]
/******/ ];
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ var checkDeferredModules = function() {};
/******/ function checkDeferredModulesImpl() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ return result;
/******/ }
/******/ __webpack_require__ .x = function() {
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
/******/ };
/******/
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/ var runtime = data[3];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length ; i + + ) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ __webpack_require__ .m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length ; i + + ) webpackJsonpCallback ( jsonpArray [ i ] ) ;
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/ }();
/******/
/******/ }
);
2016-01-04 11:07:08 +08:00
```
# Info
2017-12-14 17:58:03 +08:00
## Unoptimized
2016-01-04 11:07:08 +08:00
```
2017-12-14 17:58:03 +08:00
Hash: 0a1b2c3d4e5f6a7b8c9d
2019-02-05 01:52:39 +08:00
Version: webpack 5.0.0-alpha.9
2018-12-19 21:05:17 +08:00
Asset Size Chunks Chunk Names
2019-02-05 01:52:39 +08:00
commons-utility2_js.js 357 bytes {commons-utility2_js} [emitted]
commons-utility3_js.js 357 bytes {commons-utility3_js} [emitted]
pageA.js 5.43 KiB {pageA} [emitted] pageA
pageB.js 5.19 KiB {pageB} [emitted] pageB
pageC.js 5.13 KiB {pageC} [emitted] pageC
vendor.js 679 bytes {vendor} [emitted] vendor
2018-12-19 21:05:17 +08:00
Entrypoint pageA = vendor.js commons-utility2_js.js pageA.js
Entrypoint pageB = vendor.js commons-utility2_js.js commons-utility3_js.js pageB.js
Entrypoint pageC = commons-utility2_js.js commons-utility3_js.js pageC.js
2019-02-05 01:52:39 +08:00
chunk {commons-utility2_js} commons-utility2_js.js 28 bytes [initial] [rendered] split chunk (cache group: commons)
2018-01-20 00:06:59 +08:00
> ./pageA pageA
2018-02-17 21:14:14 +08:00
> ./pageB pageB
> ./pageC pageC
2018-12-19 21:05:17 +08:00
[3] ./utility2.js 28 bytes {commons-utility2_js} [built]
2018-09-26 05:13:58 +08:00
[used exports unknown]
2018-05-07 18:36:38 +08:00
cjs require ./utility2 [0] ./pageA.js 3:15-36
cjs require ./utility2 [4] ./pageB.js 2:15-36
cjs require ./utility2 [7] ./pageC.js 1:15-36
2019-02-05 01:52:39 +08:00
chunk {commons-utility3_js} commons-utility3_js.js 28 bytes [initial] [rendered] split chunk (cache group: commons)
2018-01-22 22:18:54 +08:00
> ./pageB pageB
2018-02-17 21:14:14 +08:00
> ./pageC pageC
2018-12-19 21:05:17 +08:00
[6] ./utility3.js 28 bytes {commons-utility3_js} [built]
2018-09-26 05:13:58 +08:00
[used exports unknown]
2018-05-07 18:36:38 +08:00
cjs require ./utility3 [4] ./pageB.js 3:15-36
cjs require ./utility3 [7] ./pageC.js 2:15-36
2019-02-05 01:52:39 +08:00
chunk {pageA} pageA.js (pageA) 165 bytes (javascript) 2.28 KiB (runtime) [entry] [rendered]
2018-12-19 21:05:17 +08:00
> ./pageA pageA
[0] ./pageA.js 137 bytes {pageA} [built]
[used exports unknown]
entry ./pageA pageA
[2] ./utility1.js 28 bytes {pageA} [built]
[used exports unknown]
cjs require ./utility1 [0] ./pageA.js 2:15-36
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {pageB} pageB.js (pageB) 137 bytes (javascript) 2.3 KiB (runtime) [entry] [rendered]
2018-12-19 21:05:17 +08:00
> ./pageB pageB
[4] ./pageB.js 137 bytes {pageB} [built]
[used exports unknown]
entry ./pageB pageB
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {pageC} pageC.js (pageC) 102 bytes (javascript) 2.29 KiB (runtime) [entry] [rendered]
2018-09-25 23:08:35 +08:00
> ./pageC pageC
2018-12-19 21:05:17 +08:00
[7] ./pageC.js 102 bytes {pageC} [built]
2018-09-26 05:13:58 +08:00
[used exports unknown]
2018-12-19 21:05:17 +08:00
entry ./pageC pageC
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {vendor} vendor.js (vendor) 54 bytes [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
2018-12-19 21:05:17 +08:00
> ./pageA pageA
> ./pageB pageB
[1] ./node_modules/vendor1.js 27 bytes {vendor} [built]
[used exports unknown]
cjs require vendor1 [0] ./pageA.js 1:14-32
[5] ./node_modules/vendor2.js 27 bytes {vendor} [built]
[used exports unknown]
cjs require vendor2 [4] ./pageB.js 1:14-32
2016-01-04 11:07:08 +08:00
```
2017-12-14 17:58:03 +08:00
## Production mode
2016-01-04 11:07:08 +08:00
```
2017-12-14 17:58:03 +08:00
Hash: 0a1b2c3d4e5f6a7b8c9d
2019-02-05 01:52:39 +08:00
Version: webpack 5.0.0-alpha.9
2018-12-19 21:05:17 +08:00
Asset Size Chunks Chunk Names
commons-utility2_js.js 117 bytes {commons-utility2_js} [emitted]
commons-utility3_js.js 118 bytes {commons-utility3_js} [emitted]
pageA.js 959 bytes {pageA} [emitted] pageA
pageB.js 943 bytes {pageB} [emitted] pageB
pageC.js 927 bytes {pageC} [emitted] pageC
vendor.js 141 bytes {vendor} [emitted] vendor
Entrypoint pageA = vendor.js commons-utility2_js.js pageA.js
Entrypoint pageB = vendor.js commons-utility2_js.js commons-utility3_js.js pageB.js
Entrypoint pageC = commons-utility2_js.js commons-utility3_js.js pageC.js
2019-02-05 01:52:39 +08:00
chunk {commons-utility2_js} commons-utility2_js.js 28 bytes [initial] [rendered] split chunk (cache group: commons)
2018-01-25 06:23:34 +08:00
> ./pageA pageA
2018-02-17 21:14:14 +08:00
> ./pageB pageB
> ./pageC pageC
2018-12-19 21:05:17 +08:00
[37] ./utility2.js 28 bytes {commons-utility2_js} [built]
cjs require ./utility2 [912] ./pageC.js 1:15-36
cjs require ./utility2 [953] ./pageA.js 3:15-36
cjs require ./utility2 [954] ./pageB.js 2:15-36
2019-02-05 01:52:39 +08:00
chunk {commons-utility3_js} commons-utility3_js.js 28 bytes [initial] [rendered] split chunk (cache group: commons)
2018-01-22 22:18:54 +08:00
> ./pageB pageB
> ./pageC pageC
2018-12-19 21:05:17 +08:00
[544] ./utility3.js 28 bytes {commons-utility3_js} [built]
cjs require ./utility3 [912] ./pageC.js 2:15-36
cjs require ./utility3 [954] ./pageB.js 3:15-36
2019-02-05 01:52:39 +08:00
chunk {pageA} pageA.js (pageA) 165 bytes (javascript) 2.28 KiB (runtime) [entry] [rendered]
2018-02-17 21:14:14 +08:00
> ./pageA pageA
2018-12-19 21:05:17 +08:00
[105] ./utility1.js 28 bytes {pageA} [built]
cjs require ./utility1 [953] ./pageA.js 2:15-36
[953] ./pageA.js 137 bytes {pageA} [built]
entry ./pageA pageA
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {pageB} pageB.js (pageB) 137 bytes (javascript) 2.3 KiB (runtime) [entry] [rendered]
2018-02-17 21:14:14 +08:00
> ./pageB pageB
2018-12-19 21:05:17 +08:00
[954] ./pageB.js 137 bytes {pageB} [built]
entry ./pageB pageB
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {pageC} pageC.js (pageC) 102 bytes (javascript) 2.3 KiB (runtime) [entry] [rendered]
2018-12-19 21:05:17 +08:00
> ./pageC pageC
[912] ./pageC.js 102 bytes {pageC} [built]
entry ./pageC pageC
+ 1 hidden chunk module
2019-02-05 01:52:39 +08:00
chunk {vendor} vendor.js (vendor) 54 bytes [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
2018-01-20 00:06:59 +08:00
> ./pageA pageA
> ./pageB pageB
2018-12-19 21:05:17 +08:00
[333] ./node_modules/vendor1.js 27 bytes {vendor} [built]
cjs require vendor1 [953] ./pageA.js 1:14-32
[407] ./node_modules/vendor2.js 27 bytes {vendor} [built]
cjs require vendor2 [954] ./pageB.js 1:14-32
2016-01-04 11:07:08 +08:00
```