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: {
splitChunks: {
cacheGroups: {
2018-01-22 22:18:54 +08:00
commons: {
chunks: "initial",
minChunks: 2,
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",
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-01-22 22:18:54 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
2018-01-20 00:06:59 +08:00
/***/ 1:
/*!*********************************!*\
!*** ./node_modules/vendor1.js ** *!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "vendor1";
/***/ }),
/***/ 5:
/*!*********************************!*\
!*** ./node_modules/vendor2.js ** *!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "vendor2";
/***/ })
}]);
```
2018-01-22 22:18:54 +08:00
# dist/commons~pageA~pageB~pageC.js
2018-01-20 00:06:59 +08:00
``` javascript
2018-01-22 22:18:54 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
2018-01-20 00:06:59 +08:00
/***/ 3:
/*!*********************!*\
!*** ./utility2.js ** *!
\*********************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "utility2";
2018-01-22 22:18:54 +08:00
/***/ })
}]);
```
# dist/commons~pageB~pageC.js
``` javascript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
2018-01-20 00:06:59 +08:00
/***/ 6:
/*!*********************!*\
!*** ./utility3.js ** *!
\*********************/
/*! no static exports found */
/***/ (function(module, exports) {
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
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
2017-11-23 16:47:19 +08:00
/******/ function webpackJsonpCallback(data) {
2018-01-20 00:06:59 +08:00
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1]
/******/ var executeModules = data[2];
2016-01-04 11:07:08 +08:00
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
2018-01-20 00:06:59 +08:00
/******/ var moduleId, chunkId, i = 0, resolves = [];
2016-01-04 11:07:08 +08:00
/******/ for(;i < chunkIds.length ; i + + ) {
/******/ chunkId = chunkIds[i];
2017-05-23 04:45:18 +08:00
/******/ if(installedChunks[chunkId]) {
2016-01-04 11:07:08 +08:00
/******/ resolves.push(installedChunks[chunkId][0]);
2017-05-23 04:45:18 +08:00
/******/ }
2016-01-04 11:07:08 +08:00
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
2016-06-06 02:51:44 +08:00
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
2016-01-04 11:07:08 +08:00
/******/ }
2017-11-23 16:47:19 +08:00
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
2017-05-23 04:45:18 +08:00
/******/ while(resolves.length) {
2016-01-04 11:07:08 +08:00
/******/ resolves.shift()();
2017-05-23 04:45:18 +08:00
/******/ }
2017-11-23 16:47:19 +08:00
/******/
2018-01-20 00:06:59 +08:00
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
2017-11-23 16:47:19 +08:00
/******/ var fullfilled = true;
2018-01-20 00:06:59 +08:00
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
2017-11-23 16:47:19 +08:00
/******/ if(installedChunks[depId] !== 0) fullfilled = false;
/******/ }
/******/ if(fullfilled) {
2018-01-20 00:06:59 +08:00
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
2016-06-06 02:51:44 +08:00
/******/ }
2016-01-04 11:07:08 +08:00
/******/ }
2016-06-06 02:51:44 +08:00
/******/ return result;
2018-01-20 00:06:59 +08:00
/******/ }
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // The module cache
/******/ var installedModules = {};
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ // object to store loaded and loading chunks
2016-01-04 11:07:08 +08:00
/******/ var installedChunks = {
2017-12-14 17:58:03 +08:00
/******/ 0: 0
2016-01-04 11:07:08 +08:00
/******/ };
2017-03-31 02:25:01 +08:00
/******/
2018-01-20 00:06:59 +08:00
/******/ var deferredModules = [];
2017-11-23 16:47:19 +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
/******/
2016-01-04 11:07:08 +08:00
/******/ // expose the module cache
/******/ __webpack_require__ .c = installedModules;
2017-03-31 02:25:01 +08:00
/******/
2016-12-08 02:14:47 +08:00
/******/ // define getter function for harmony exports
2016-09-07 18:28:56 +08:00
/******/ __webpack_require__ .d = function(exports, name, getter) {
2016-12-14 19:03:24 +08:00
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
2016-09-07 18:28:56 +08:00
/******/ };
2017-03-31 02:25:01 +08:00
/******/
2017-11-24 15:40:39 +08:00
/******/ // define __esModule on exports
/******/ __webpack_require__ .r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
2016-09-07 18:28:56 +08:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__ .n = function(module) {
/******/ var getter = module & & module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__ .d(getter, 'a', getter);
/******/ return getter;
/******/ };
2017-03-31 02:25:01 +08:00
/******/
2016-09-07 18:28:56 +08:00
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__ .o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
2017-03-31 02:25:01 +08:00
/******/
2016-02-04 20:02:53 +08:00
/******/ // __webpack_public_path__
2018-01-05 04:39:29 +08:00
/******/ __webpack_require__ .p = "dist/";
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
2018-01-20 00:06:59 +08:00
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
2017-11-23 16:47:19 +08:00
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length ; i + + ) webpackJsonpCallback ( jsonpArray [ i ] ) ;
2018-01-20 00:06:59 +08:00
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
2017-11-23 16:47:19 +08:00
/******/
2018-01-20 00:06:59 +08:00
/******/ // add entry module to deferred list
2018-01-22 22:18:54 +08:00
/******/ deferredModules.push([0,3,5]);
2018-01-20 00:06:59 +08:00
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
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 ** *!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __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 ** *!
\*********************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "utility1";
2017-03-31 02:25:01 +08:00
/***/ })
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/pageB.js
2016-01-04 11:07:08 +08:00
``` javascript
2018-01-20 00:06:59 +08:00
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1]
/******/ var executeModules = data[2];
/******/ // 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)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
/******/ var fullfilled = true;
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fullfilled = false;
/******/ }
/******/ if(fullfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 1: 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // 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;
/******/
/******/ // expose the module cache
/******/ __webpack_require__ .c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__ .d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__ .r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__ .n = function(module) {
/******/ var getter = module & & module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__ .d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__ .o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__ .p = "dist/";
/******/
/******/ 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;
/******/
/******/
/******/ // add entry module to deferred list
2018-01-22 22:18:54 +08:00
/******/ deferredModules.push([4,3,4,5]);
2018-01-20 00:06:59 +08:00
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ({
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 ** *!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __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-01-20 00:06:59 +08:00
/******/ });
2016-01-04 11:07:08 +08:00
```
2018-01-05 04:39:29 +08:00
# dist/pageC.js
2016-01-04 11:07:08 +08:00
``` javascript
2018-01-20 00:06:59 +08:00
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1]
/******/ var executeModules = data[2];
/******/ // 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)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length ; i + + ) {
/******/ var deferredModule = deferredModules[i];
/******/ var fullfilled = true;
/******/ for(var j = 1; j < deferredModule.length ; j + + ) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fullfilled = false;
/******/ }
/******/ if(fullfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__ (__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 2: 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // 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;
/******/
/******/ // expose the module cache
/******/ __webpack_require__ .c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__ .d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__ .r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__ .n = function(module) {
/******/ var getter = module & & module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__ .d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__ .o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__ .p = "dist/";
/******/
/******/ 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;
/******/
/******/
/******/ // add entry module to deferred list
2018-01-22 22:18:54 +08:00
/******/ deferredModules.push([7,3,4]);
2018-01-20 00:06:59 +08:00
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ({
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 ** *!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __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-01-20 00:06:59 +08:00
/******/ });
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
2018-02-13 17:18:53 +08:00
Version: webpack 4.0.0-beta.1
2018-01-22 22:18:54 +08:00
Asset Size Chunks Chunk Names
2018-02-13 17:18:53 +08:00
pageA.js 5.59 KiB 0 [emitted] pageA
2018-01-22 22:18:54 +08:00
pageB.js 5.4 KiB 1 [emitted] pageB
pageC.js 5.34 KiB 2 [emitted] pageC
commons~pageA~pageB~pageC.js 269 bytes 3 [emitted] commons~pageA~pageB~pageC
commons~pageB~pageC.js 269 bytes 4 [emitted] commons~pageB~pageC
vendor.js 536 bytes 5 [emitted] vendor
Entrypoint pageA = commons~pageA~pageB~pageC.js vendor.js pageA.js
Entrypoint pageB = commons~pageA~pageB~pageC.js commons~pageB~pageC.js vendor.js pageB.js
Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js
2018-02-13 17:18:53 +08:00
chunk {0} pageA.js (pageA) 165 bytes ={3}= ={5}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageA pageA
2018-02-13 17:18:53 +08:00
[0] ./pageA.js 137 bytes {0} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageA pageA
2018-01-20 00:06:59 +08:00
[2] ./utility1.js 28 bytes {0} [built]
cjs require ./utility1 [0] ./pageA.js 2:15-36
2018-02-13 17:18:53 +08:00
chunk {1} pageB.js (pageB) 137 bytes ={3}= ={4}= ={5}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageB pageB
2018-02-13 17:18:53 +08:00
[4] ./pageB.js 137 bytes {1} [built]
2017-12-14 17:58:03 +08:00
single entry ./pageB pageB
2018-01-22 22:18:54 +08:00
chunk {2} pageC.js (pageC) 105 bytes ={3}= ={4}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageC pageC
[7] ./pageC.js 105 bytes {2} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageC pageC
2018-01-22 22:18:54 +08:00
chunk {3} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={4}= ={2}= ={5}= ={1}= ={0}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
2018-01-20 00:06:59 +08:00
> ./pageC pageC
> ./pageB pageB
> ./pageA pageA
2018-01-22 22:18:54 +08:00
[3] ./utility2.js 28 bytes {3} [built]
2018-01-20 00:06:59 +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
2018-01-22 22:18:54 +08:00
chunk {4} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={3}= ={2}= ={5}= ={1}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
2018-01-20 00:06:59 +08:00
[6] ./utility3.js 28 bytes {4} [built]
cjs require ./utility3 [4] ./pageB.js 3:15-36
cjs require ./utility3 [7] ./pageC.js 2:15-36
2018-01-22 22:18:54 +08:00
chunk {5} vendor.js (vendor) 54 bytes ={3}= ={0}= ={4}= ={1}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
> ./pageA pageA
> ./pageB pageB
2 modules
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
2018-02-13 17:18:53 +08:00
Version: webpack 4.0.0-beta.1
2018-01-22 22:18:54 +08:00
Asset Size Chunks Chunk Names
2018-01-25 06:23:34 +08:00
commons~pageA~pageB~pageC.js 96 bytes 0 [emitted] commons~pageA~pageB~pageC
vendor.js 134 bytes 1 [emitted] vendor
commons~pageB~pageC.js 97 bytes 2 [emitted] commons~pageB~pageC
2018-01-22 22:18:54 +08:00
pageC.js 1.1 KiB 3 [emitted] pageC
pageB.js 1.11 KiB 4 [emitted] pageB
pageA.js 1.15 KiB 5 [emitted] pageA
Entrypoint pageA = commons~pageA~pageB~pageC.js vendor.js pageA.js
Entrypoint pageB = commons~pageA~pageB~pageC.js commons~pageB~pageC.js vendor.js pageB.js
Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js
2018-01-25 06:23:34 +08:00
chunk {0} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes ={2}= ={3}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageA~pageB~pageC)
> ./pageC pageC
> ./pageB pageB
> ./pageA pageA
[0] ./utility2.js 28 bytes {0} [built]
cjs require ./utility2 [2] ./pageC.js 1:15-36
cjs require ./utility2 [4] ./pageB.js 2:15-36
cjs require ./utility2 [7] ./pageA.js 3:15-36
chunk {1} vendor.js (vendor) 54 bytes ={0}= ={5}= ={2}= ={4}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
2018-01-22 22:18:54 +08:00
> ./pageA pageA
> ./pageB pageB
2 modules
2018-01-25 06:23:34 +08:00
chunk {2} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={0}= ={3}= ={1}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC)
2018-01-22 22:18:54 +08:00
> ./pageC pageC
> ./pageB pageB
2018-01-25 06:23:34 +08:00
[1] ./utility3.js 28 bytes {2} [built]
2018-01-22 22:18:54 +08:00
cjs require ./utility3 [2] ./pageC.js 2:15-36
cjs require ./utility3 [4] ./pageB.js 3:15-36
2018-01-25 06:23:34 +08:00
chunk {3} pageC.js (pageC) 105 bytes ={0}= ={2}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageC pageC
2018-01-22 22:18:54 +08:00
[2] ./pageC.js 105 bytes {3} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageC pageC
2018-02-13 17:18:53 +08:00
chunk {4} pageB.js (pageB) 137 bytes ={0}= ={2}= ={1}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageB pageB
2018-02-13 17:18:53 +08:00
[4] ./pageB.js 137 bytes {4} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageB pageB
2018-02-13 17:18:53 +08:00
chunk {5} pageA.js (pageA) 165 bytes ={0}= ={1}= [entry] [rendered]
2018-01-20 00:06:59 +08:00
> ./pageA pageA
2018-01-22 22:18:54 +08:00
[5] ./utility1.js 28 bytes {5} [built]
2018-01-20 00:06:59 +08:00
cjs require ./utility1 [7] ./pageA.js 2:15-36
2018-02-13 17:18:53 +08:00
[7] ./pageA.js 137 bytes {5} [built]
2017-12-21 18:19:53 +08:00
single entry ./pageA pageA
2016-01-04 11:07:08 +08:00
```