webpack/examples/common-chunk-and-vendor-chunk/README.md

511 lines
16 KiB
Markdown
Raw Normal View History

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");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
2017-11-24 15:40:39 +08:00
mode: "production",
2016-01-04 11:07:08 +08:00
entry: {
vendor: ["./vendor1", "./vendor2"],
pageA: "./pageA",
pageB: "./pageB",
pageC: "./pageC"
// older versions of webpack may require an empty entry point declaration here
// common: []
},
output: {
path: path.join(__dirname, "js"),
filename: "[name].js"
},
plugins: [
new CommonsChunkPlugin({
// The order of this array matters
names: ["common", "vendor"],
minChunks: 2
})
]
};
```
# js/vendor.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) {
/******/ var chunkIds = data[0], moreModules = data[1], 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
2016-06-06 02:51:44 +08:00
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
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
/******/ scheduledModules.push.apply(scheduledModules, executeModules || []);
/******/
/******/ for(i = 0; i < scheduledModules.length; i++) {
/******/ var scheduledModule = scheduledModules[i];
/******/ var fullfilled = true;
/******/ for(var j = 1; j < scheduledModule.length; j++) {
/******/ var depId = scheduledModule[j];
/******/ if(installedChunks[depId] !== 0) fullfilled = false;
/******/ }
/******/ if(fullfilled) {
/******/ scheduledModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = scheduledModule[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;
2016-01-04 11:07:08 +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 = {
2016-09-07 18:28:56 +08:00
/******/ 4: 0
2016-01-04 11:07:08 +08:00
/******/ };
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ var scheduledModules = [];
/******/
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
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
2017-11-23 16:47:19 +08:00
/******/ var promises = [];
2017-03-31 02:25:01 +08:00
/******/
/******/
2017-11-23 16:47:19 +08:00
/******/ // JSONP chunk loading for javascript
/******/
/******/ var installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ promises.push(installedChunkData[2] = promise);
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ // start chunk loading
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120000;
/******/
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
2017-05-23 04:45:18 +08:00
/******/ }
2017-11-23 16:47:19 +08:00
/******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
/******/ var timeout = setTimeout(function(){
/******/ onScriptComplete({ type: 'timeout', target: script });
/******/ }, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete(event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')');
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ chunk[1](error);
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ head.appendChild(script);
2016-01-04 11:07:08 +08:00
/******/ }
2017-11-23 16:47:19 +08:00
/******/ }
/******/ return Promise.all(promises);
2016-01-04 11:07:08 +08:00
/******/ };
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__
/******/ __webpack_require__.p = "js/";
2017-03-31 02:25:01 +08:00
/******/
2016-01-04 11:07:08 +08:00
/******/ // on error function for async loading
2016-06-06 02:51:44 +08:00
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
2017-03-31 02:25:01 +08:00
/******/
2017-11-23 16:47:19 +08:00
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var parentJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/
2016-01-04 11:07:08 +08:00
/******/ // Load entry module and return exports
2017-06-05 22:12:12 +08:00
/******/ return __webpack_require__(__webpack_require__.s = 2);
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
/******/ ([
/* 0 */,
/* 1 */,
/* 2 */
/*!*********************************!*\
!*** multi ./vendor1 ./vendor2 ***!
\*********************************/
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-06-05 22:12:12 +08:00
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./vendor1 */3);
module.exports = __webpack_require__(/*! ./vendor2 */4);
2016-01-04 11:07:08 +08:00
2017-06-05 22:12:12 +08:00
/***/ }),
/* 3 */
2016-01-04 11:07:08 +08:00
/*!********************!*\
!*** ./vendor1.js ***!
\********************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "vendor1";
2016-01-04 11:07:08 +08:00
2017-03-31 02:25:01 +08:00
/***/ }),
2017-06-05 22:12:12 +08:00
/* 4 */
2016-01-04 11:07:08 +08:00
/*!********************!*\
!*** ./vendor2.js ***!
\********************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "vendor2";
2016-01-04 11:07:08 +08:00
2017-03-31 02:25:01 +08:00
/***/ })
2017-06-05 22:12:12 +08:00
/******/ ]);
2016-01-04 11:07:08 +08:00
```
# js/common.js
``` javascript
2017-11-23 16:47:19 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],[
2016-01-04 11:07:08 +08:00
/* 0 */
/*!*********************!*\
!*** ./utility2.js ***!
\*********************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "utility2";
2016-01-04 11:07:08 +08:00
2017-03-31 02:25:01 +08:00
/***/ }),
2016-01-04 11:07:08 +08:00
/* 1 */
/*!*********************!*\
!*** ./utility3.js ***!
\*********************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
module.exports = "utility3";
2016-01-04 11:07:08 +08:00
2017-03-31 02:25:01 +08:00
/***/ })
2017-11-23 16:47:19 +08:00
]]);
2016-01-04 11:07:08 +08:00
```
# js/pageA.js
``` javascript
2017-11-23 16:47:19 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{
2016-01-04 11:07:08 +08:00
/***/ 5:
/*!******************!*\
!*** ./pageA.js ***!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __webpack_require__) {
2016-01-04 11:07:08 +08:00
2017-06-05 22:12:12 +08:00
var utility1 = __webpack_require__(/*! ./utility1 */ 6);
2016-09-07 18:28:56 +08:00
var utility2 = __webpack_require__(/*! ./utility2 */ 0);
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
2017-06-05 22:12:12 +08:00
/***/ }),
/***/ 6:
/*!*********************!*\
!*** ./utility1.js ***!
\*********************/
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-06-05 22:12:12 +08:00
/***/ (function(module, exports) {
module.exports = "utility1";
2017-03-31 02:25:01 +08:00
/***/ })
2016-01-04 11:07:08 +08:00
2017-11-23 16:47:19 +08:00
},[[5,4,0,1]]]);
2016-01-04 11:07:08 +08:00
```
# js/pageB.js
``` javascript
2017-11-23 16:47:19 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
2016-01-04 11:07:08 +08:00
2017-06-05 22:12:12 +08:00
/***/ 7:
2016-01-04 11:07:08 +08:00
/*!******************!*\
!*** ./pageB.js ***!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __webpack_require__) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
var utility2 = __webpack_require__(/*! ./utility2 */ 0);
var utility3 = __webpack_require__(/*! ./utility3 */ 1);
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
2017-03-31 02:25:01 +08:00
/***/ })
2016-01-04 11:07:08 +08:00
2017-11-23 16:47:19 +08:00
},[[7,4,0,3]]]);
2016-01-04 11:07:08 +08:00
```
# js/pageC.js
``` javascript
2017-11-23 16:47:19 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
2016-01-04 11:07:08 +08:00
2017-06-05 22:12:12 +08:00
/***/ 8:
2016-01-04 11:07:08 +08:00
/*!******************!*\
!*** ./pageC.js ***!
\******************/
2017-06-05 22:12:12 +08:00
/*! no static exports found */
/*! all exports used */
2017-11-24 15:40:39 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2017-03-31 02:25:01 +08:00
/***/ (function(module, exports, __webpack_require__) {
2016-01-04 11:07:08 +08:00
2016-09-07 18:28:56 +08:00
var utility2 = __webpack_require__(/*! ./utility2 */ 0);
var utility3 = __webpack_require__(/*! ./utility3 */ 1);
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
2017-11-23 16:47:19 +08:00
},[[8,4,0,2]]]);
2016-01-04 11:07:08 +08:00
```
# Info
## Uncompressed
```
2017-11-23 16:47:19 +08:00
Hash: 4b8ef245065d9c193fc3
Version: webpack next
2016-01-04 11:07:08 +08:00
Asset Size Chunks Chunk Names
2017-11-24 15:40:39 +08:00
common.js 651 bytes 0 [emitted] common
pageA.js 795 bytes 1 [emitted] pageA
pageC.js 503 bytes 2 [emitted] pageC
pageB.js 503 bytes 3 [emitted] pageB
vendor.js 8.15 KiB 4 [emitted] vendor
Entrypoint vendor = vendor.js
2016-09-07 18:28:56 +08:00
Entrypoint pageA = vendor.js common.js pageA.js
Entrypoint pageB = vendor.js common.js pageB.js
Entrypoint pageC = vendor.js common.js pageC.js
chunk {0} common.js (common) 56 bytes {4} [initial] [rendered]
[0] ./utility2.js 28 bytes {0} [built]
2016-01-04 11:07:08 +08:00
cjs require ./utility2 [5] ./pageA.js 2:15-36
2017-06-05 22:12:12 +08:00
cjs require ./utility2 [7] ./pageB.js 1:15-36
cjs require ./utility2 [8] ./pageC.js 1:15-36
2016-09-07 18:28:56 +08:00
[1] ./utility3.js 28 bytes {0} [built]
2017-06-05 22:12:12 +08:00
cjs require ./utility3 [7] ./pageB.js 2:15-36
cjs require ./utility3 [8] ./pageC.js 2:15-36
2016-12-14 19:03:24 +08:00
chunk {1} pageA.js (pageA) 133 bytes {0} [initial] [rendered]
2016-01-04 11:07:08 +08:00
> pageA [5] ./pageA.js
2016-12-14 19:03:24 +08:00
[5] ./pageA.js 105 bytes {1} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageA pageA
2017-06-05 22:12:12 +08:00
[6] ./utility1.js 28 bytes {1} [built]
cjs require ./utility1 [5] ./pageA.js 1:15-36
2016-12-14 19:03:24 +08:00
chunk {2} pageC.js (pageC) 105 bytes {0} [initial] [rendered]
2017-06-05 22:12:12 +08:00
> pageC [8] ./pageC.js
[8] ./pageC.js 105 bytes {2} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageC pageC
2016-12-14 19:03:24 +08:00
chunk {3} pageB.js (pageB) 105 bytes {0} [initial] [rendered]
2017-06-05 22:12:12 +08:00
> pageB [7] ./pageB.js
[7] ./pageB.js 105 bytes {3} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageB pageB
2016-09-07 18:28:56 +08:00
chunk {4} vendor.js (vendor) 94 bytes [entry] [rendered]
2017-06-05 22:12:12 +08:00
> vendor [2] multi ./vendor1 ./vendor2
[2] multi ./vendor1 ./vendor2 40 bytes {4} [built]
2017-11-23 16:47:19 +08:00
multi entry
2016-09-07 18:28:56 +08:00
[3] ./vendor1.js 27 bytes {4} [built]
2017-06-05 22:12:12 +08:00
single entry ./vendor1 [2] multi ./vendor1 ./vendor2 vendor:100000
2016-09-07 18:28:56 +08:00
[4] ./vendor2.js 27 bytes {4} [built]
2017-06-05 22:12:12 +08:00
single entry ./vendor2 [2] multi ./vendor1 ./vendor2 vendor:100001
2016-01-04 11:07:08 +08:00
```
## Minimized (uglify-js, no zip)
```
2017-11-23 16:47:19 +08:00
Hash: 4b8ef245065d9c193fc3
Version: webpack next
2016-01-04 11:07:08 +08:00
Asset Size Chunks Chunk Names
2017-11-23 16:47:19 +08:00
common.js 132 bytes 0 [emitted] common
pageA.js 157 bytes 1 [emitted] pageA
pageC.js 119 bytes 2 [emitted] pageC
pageB.js 119 bytes 3 [emitted] pageB
2017-11-24 15:40:39 +08:00
vendor.js 1.82 KiB 4 [emitted] vendor
Entrypoint vendor = vendor.js
2016-09-07 18:28:56 +08:00
Entrypoint pageA = vendor.js common.js pageA.js
Entrypoint pageB = vendor.js common.js pageB.js
Entrypoint pageC = vendor.js common.js pageC.js
chunk {0} common.js (common) 56 bytes {4} [initial] [rendered]
[0] ./utility2.js 28 bytes {0} [built]
2016-01-04 11:07:08 +08:00
cjs require ./utility2 [5] ./pageA.js 2:15-36
2017-06-05 22:12:12 +08:00
cjs require ./utility2 [7] ./pageB.js 1:15-36
cjs require ./utility2 [8] ./pageC.js 1:15-36
2016-09-07 18:28:56 +08:00
[1] ./utility3.js 28 bytes {0} [built]
2017-06-05 22:12:12 +08:00
cjs require ./utility3 [7] ./pageB.js 2:15-36
cjs require ./utility3 [8] ./pageC.js 2:15-36
2016-12-14 19:03:24 +08:00
chunk {1} pageA.js (pageA) 133 bytes {0} [initial] [rendered]
2016-01-04 11:07:08 +08:00
> pageA [5] ./pageA.js
2016-12-14 19:03:24 +08:00
[5] ./pageA.js 105 bytes {1} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageA pageA
2017-06-05 22:12:12 +08:00
[6] ./utility1.js 28 bytes {1} [built]
cjs require ./utility1 [5] ./pageA.js 1:15-36
2016-12-14 19:03:24 +08:00
chunk {2} pageC.js (pageC) 105 bytes {0} [initial] [rendered]
2017-06-05 22:12:12 +08:00
> pageC [8] ./pageC.js
[8] ./pageC.js 105 bytes {2} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageC pageC
2016-12-14 19:03:24 +08:00
chunk {3} pageB.js (pageB) 105 bytes {0} [initial] [rendered]
2017-06-05 22:12:12 +08:00
> pageB [7] ./pageB.js
[7] ./pageB.js 105 bytes {3} [built]
2017-11-23 16:47:19 +08:00
single entry ./pageB pageB
2016-09-07 18:28:56 +08:00
chunk {4} vendor.js (vendor) 94 bytes [entry] [rendered]
2017-06-05 22:12:12 +08:00
> vendor [2] multi ./vendor1 ./vendor2
[2] multi ./vendor1 ./vendor2 40 bytes {4} [built]
2017-11-23 16:47:19 +08:00
multi entry
2016-09-07 18:28:56 +08:00
[3] ./vendor1.js 27 bytes {4} [built]
2017-06-05 22:12:12 +08:00
single entry ./vendor1 [2] multi ./vendor1 ./vendor2 vendor:100000
2016-09-07 18:28:56 +08:00
[4] ./vendor2.js 27 bytes {4} [built]
2017-06-05 22:12:12 +08:00
single entry ./vendor2 [2] multi ./vendor1 ./vendor2 vendor:100001
2016-01-04 11:07:08 +08:00
```