webpack/examples/scope-hoisting/README.md

543 lines
18 KiB
Markdown
Raw Normal View History

2017-05-10 19:15:14 +08:00
This example demonstrates Scope Hoisting in combination with Code Splitting.
This is the dependency graph for the example: (solid lines express sync imports, dashed lines async imports)
![](graph.png)
All modules except `cjs` are EcmaScript modules. `cjs` is a CommonJs module.
The interesting thing here is that putting all modules in single scope won't work, because of multiple reasons:
2019-04-09 02:29:40 +08:00
- Modules `lazy`, `c`, `d` and `cjs` need to be in a separate chunk
- Module `shared` is accessed by two chunks (different scopes)
- Module `cjs` is a CommonJs module
2017-05-10 19:15:14 +08:00
![](graph2.png)
webpack therefore uses a approach called **"Partial Scope Hoisting"** or "Module concatenation", which chooses the largest possible subsets of ES modules which can be scope hoisted and combines them with the default webpack primitives.
![](graph3.png)
2018-02-26 10:26:51 +08:00
While module concatenation identifiers in modules are renamed to avoid conflicts and internal imports are simplified. External imports and exports from the root module use the existing ESM constructs.
2017-05-10 19:15:14 +08:00
# example.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
import { a, x, y } from "a";
import * as b from "b";
import("./lazy").then(function(lazy) {
console.log(a, b.a(), x, y, lazy.c, lazy.d.a, lazy.x, lazy.y);
});
```
# lazy.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
export * from "c";
import * as d from "d";
export { d };
```
# a.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// module a
export var a = "a";
export * from "shared";
```
# b.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// module b
export function a() {
return "b";
};
```
# c.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// module c
import { c as e } from "cjs";
export var c = String.fromCharCode(e.charCodeAt(0) - 2);
export { x, y } from "shared";
```
# d.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// module d
export var a = "d";
```
# cjs.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// module cjs (commonjs)
exports.c = "e";
```
# shared.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// shared module
export var x = "x";
export * from "shared2";
```
# shared2.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
// shared2 module
export var y = "y";
```
# webpack.config.js
2019-04-09 02:29:40 +08:00
```javascript
2017-05-10 19:15:14 +08:00
module.exports = {
2017-12-14 17:58:03 +08:00
// mode: "development" || "production",
optimization: {
usedExports: true,
concatenateModules: true,
2018-12-19 21:05:17 +08:00
chunkIds: "deterministic" // To keep filename consistent between different modes (for example building only)
2017-12-14 17:58:03 +08:00
}
2017-05-10 19:15:14 +08:00
};
```
# dist/output.js
2017-05-10 19:15:14 +08:00
2019-04-09 02:29:40 +08:00
```javascript
2019-10-11 05:11:05 +08:00
/******/ (() => { // webpackBootstrap
2018-12-19 21:05:17 +08:00
/******/ "use strict";
2019-10-11 05:11:05 +08:00
/******/ var __webpack_modules__ = ([
/* 0 */,
2018-09-26 05:13:58 +08:00
/* 1 */
/*!********************************************!*\
!*** ./node_modules/shared.js + 1 modules ***!
\********************************************/
2019-02-05 01:52:39 +08:00
/*! export x [provided] [used] [can be renamed] */
/*! export y [provided] [used] [can be renamed] */
2019-08-05 19:32:25 +08:00
/*! other exports [not provided] [unused] */
2019-10-11 05:11:05 +08:00
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2018-09-26 05:13:58 +08:00
// CONCATENATED MODULE: ./node_modules/shared2.js
// shared2 module
var y = "y";
// CONCATENATED MODULE: ./node_modules/shared.js
2019-10-09 05:45:47 +08:00
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "x": () => /* binding */ x,
/* harmony export */ "y": () => /* concated reexport __WEBPACK_MODULE_REFERENCE__0_5b2279225d_asiSafe__ */ y
/* harmony export */ });
2018-09-26 05:13:58 +08:00
// shared module
var x = "x";
2017-05-10 19:15:14 +08:00
/***/ })
2019-10-11 05:11:05 +08:00
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
2018-12-19 21:05:17 +08:00
/******/
2019-10-11 05:11:05 +08:00
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
2018-12-19 21:05:17 +08:00
/******/ };
/******/
2019-10-11 05:11:05 +08:00
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
2018-12-19 21:05:17 +08:00
/******/
2019-10-11 05:11:05 +08:00
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
2018-12-19 21:05:17 +08:00
/******/ /* webpack/runtime/ensure chunk */
/******/ !function() {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
2019-10-09 05:45:47 +08:00
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
2019-08-05 19:32:25 +08:00
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
2018-12-19 21:05:17 +08:00
/******/ };
/******/ }();
/******/
2019-10-11 05:11:05 +08:00
/******/ /* webpack/runtime/define property getters */
2018-12-19 21:05:17 +08:00
/******/ !function() {
2019-10-11 05:11:05 +08:00
/******/ // define getter functions for harmony exports
/******/ var hasOwnProperty = Object.prototype.hasOwnProperty;
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(hasOwnProperty.call(definition, key) && !hasOwnProperty.call(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
2019-10-09 05:45:47 +08:00
/******/ }
2019-10-11 05:11:05 +08:00
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
2018-12-19 21:05:17 +08:00
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ !function() {
/******/ __webpack_require__.p = "dist/";
/******/ }();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ !function() {
2019-05-10 03:34:28 +08:00
/******/ // This function allow to reference async chunks
2019-10-09 05:45:47 +08:00
/******/ __webpack_require__.u = (chunkId) => {
2019-02-05 01:52:39 +08:00
/******/ // return url for filenames based on template
2018-12-19 21:05:17 +08:00
/******/ return "" + chunkId + ".output.js";
/******/ };
/******/ }();
/******/
/******/ /* 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 = {
2019-05-10 03:34:28 +08:00
/******/ 179: 0
2018-12-19 21:05:17 +08:00
/******/ };
/******/
/******/
/******/
2019-08-05 19:32:25 +08:00
/******/
2019-10-09 05:45:47 +08:00
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = Object.prototype.hasOwnProperty.call(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
2018-12-19 21:05:17 +08:00
/******/
2019-10-09 05:45:47 +08:00
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have JS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ promises.push(installedChunkData[2] = promise);
2018-12-19 21:05:17 +08:00
/******/
2019-10-09 05:45:47 +08:00
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ var loadingEnded = () => {
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) return installedChunks[chunkId][1];
/******/ if(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined;
/******/ };
/******/ var script = document.createElement('script');
/******/ var onScriptComplete;
2019-08-05 19:32:25 +08:00
/******/
2019-10-09 05:45:47 +08:00
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
2019-08-05 19:32:25 +08:00
/******/ }
2019-10-09 05:45:47 +08:00
/******/ script.src = url;
2018-12-19 21:05:17 +08:00
/******/
2019-10-09 05:45:47 +08:00
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var reportError = loadingEnded();
/******/ if(reportError) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ reportError(error);
/******/ }
/******/ };
/******/ var timeout = setTimeout(function(){
/******/ onScriptComplete({ type: 'timeout', target: script });
/******/ }, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ document.head.appendChild(script);
/******/ } else installedChunks[chunkId] = 0;
/******/
/******/ // no HMR
/******/ }
2018-12-19 21:05:17 +08:00
/******/ }
/******/
2019-10-09 05:45:47 +08:00
/******/ // no chunk preloading needed
2018-12-19 21:05:17 +08:00
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
2019-08-05 19:32:25 +08:00
/******/ // no deferred startup or startup prefetching
2018-12-19 21:05:17 +08:00
/******/
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/ 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];
2019-08-05 19:32:25 +08:00
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
2018-12-19 21:05:17 +08:00
/******/ 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()();
/******/ }
/******/
/******/ };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/ }();
/******/
2019-10-11 05:11:05 +08:00
/************************************************************************/
!function() {
/*!********************************!*\
!*** ./example.js + 2 modules ***!
\********************************/
/*! exports [not provided] [unused] */
/*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.* */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shared.js (<- Module is referenced from different chunks by these modules: ./lazy.js + 2 modules) */
// EXTERNAL MODULE: ./node_modules/shared.js + 1 modules
var shared = __webpack_require__(1);
// CONCATENATED MODULE: ./node_modules/a.js
// module a
var a = "a";
// CONCATENATED MODULE: ./node_modules/b.js
// module b
function b_a() {
return "b";
};
// CONCATENATED MODULE: ./example.js
2017-05-10 19:15:14 +08:00
2018-12-19 21:05:17 +08:00
2019-10-11 05:11:05 +08:00
__webpack_require__.e(/*! import() */ 262).then(__webpack_require__.bind(null, /*! ./lazy */ 2)).then(function(lazy) {
console.log(a, b_a(), shared.x, shared.y, lazy.c, lazy.d.a, lazy.x, lazy.y);
});
}();
/******/ })()
;
```
2019-05-10 03:34:28 +08:00
# dist/262.output.js
2017-05-10 19:15:14 +08:00
2019-04-09 02:29:40 +08:00
```javascript
2019-05-10 03:34:28 +08:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[262],[
2017-05-10 19:15:14 +08:00
/* 0 */,
/* 1 */,
/* 2 */
/*!*****************************!*\
!*** ./lazy.js + 2 modules ***!
\*****************************/
2019-02-05 01:52:39 +08:00
/*! export c [provided] [maybe used (runtime-defined)] [usage prevents renaming] */
/*! export d [provided] [maybe used (runtime-defined)] [usage prevents renaming] */
2019-08-05 19:32:25 +08:00
/*! export a [provided] [maybe used (runtime-defined)] [usage prevents renaming] */
/*! other exports [not provided] [maybe used (runtime-defined)] */
2019-02-05 01:52:39 +08:00
/*! export x [provided] [maybe used (runtime-defined)] [usage prevents renaming] */
/*! export y [provided] [maybe used (runtime-defined)] [usage prevents renaming] */
/*! other exports [not provided] [maybe used (runtime-defined)] */
2019-10-11 05:11:05 +08:00
/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__, __webpack_require__.* */
2018-04-04 21:17:13 +08:00
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/cjs.js (<- Module is not an ECMAScript module) */
2018-09-26 05:13:58 +08:00
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shared.js (<- Module is referenced from different chunks by these modules: ./lazy.js + 2 modules) */
2019-10-11 05:11:05 +08:00
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2017-05-10 19:15:14 +08:00
"use strict";
2017-12-14 17:58:03 +08:00
__webpack_require__.r(__webpack_exports__);
2017-08-08 03:22:25 +08:00
var d_namespaceObject = {};
2018-09-25 23:08:35 +08:00
__webpack_require__.r(d_namespaceObject);
2019-10-09 05:45:47 +08:00
__webpack_require__.d(d_namespaceObject, {
"a": () => a
});
2017-08-08 03:22:25 +08:00
// EXTERNAL MODULE: ./node_modules/cjs.js
2018-09-26 05:13:58 +08:00
var cjs = __webpack_require__(3);
2017-08-08 03:22:25 +08:00
// EXTERNAL MODULE: ./node_modules/shared.js + 1 modules
2018-09-26 05:13:58 +08:00
var shared = __webpack_require__(1);
2017-05-10 19:15:14 +08:00
2017-06-05 22:12:12 +08:00
// CONCATENATED MODULE: ./node_modules/c.js
2017-05-10 19:15:14 +08:00
// module c
2019-08-05 19:32:25 +08:00
var c = String.fromCharCode(cjs.c.charCodeAt(0) - 2);
2017-05-10 19:15:14 +08:00
2017-06-05 22:12:12 +08:00
// CONCATENATED MODULE: ./node_modules/d.js
2017-05-10 19:15:14 +08:00
// module d
var a = "d";
2017-06-05 22:12:12 +08:00
// CONCATENATED MODULE: ./lazy.js
2019-10-09 05:45:47 +08:00
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "c": () => /* concated reexport __WEBPACK_MODULE_REFERENCE__2_5b2263225d_asiSafe__ */ c,
/* harmony export */ "x": () => /* concated reexport __WEBPACK_MODULE_REFERENCE__2_5b2278225d_asiSafe__ */ shared.x,
/* harmony export */ "y": () => /* concated reexport __WEBPACK_MODULE_REFERENCE__2_5b2279225d_asiSafe__ */ shared.y,
/* harmony export */ "d": () => /* concated reexport __WEBPACK_MODULE_REFERENCE__3_ns_asiSafe__ */ d_namespaceObject
/* harmony export */ });
2017-05-10 19:15:14 +08:00
2018-09-26 05:13:58 +08:00
/***/ }),
/* 3 */
/*!*****************************!*\
!*** ./node_modules/cjs.js ***!
\*****************************/
2019-02-05 01:52:39 +08:00
/*! export c [maybe provided (runtime-defined)] [used] [provision prevents renaming] */
/*! other exports [maybe provided (runtime-defined)] [unused] */
2018-12-19 21:05:17 +08:00
/*! runtime requirements: __webpack_exports__ */
2018-09-26 05:13:58 +08:00
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
2019-10-11 05:11:05 +08:00
/***/ ((__unused_webpack_module, exports) => {
2018-09-26 05:13:58 +08:00
// module cjs (commonjs)
exports.c = "e";
2017-05-10 19:15:14 +08:00
/***/ })
2017-11-23 16:47:19 +08:00
]]);
2017-05-10 19:15:14 +08:00
```
Minimized
2019-04-09 02:29:40 +08:00
```javascript
2019-10-28 21:09:53 +08:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[262],{262:(r,d,a)=>{"use strict";a.r(d);var c={};a.r(c),a.d(c,{a:()=>n});var o=a(75),e=a(350),w=String.fromCharCode(o.c.charCodeAt(0)-2),n="d";a.d(d,{c:()=>w,x:()=>e.x,y:()=>e.y,d:()=>c})},75:(r,d)=>{d.c="e"}}]);
2017-05-10 19:15:14 +08:00
```
# Info
2017-12-14 17:58:03 +08:00
## Unoptimized
2017-05-10 19:15:14 +08:00
```
2017-12-14 17:58:03 +08:00
Hash: 0a1b2c3d4e5f6a7b8c9d
2019-10-28 21:09:53 +08:00
Version: webpack 5.0.0-beta.1
2019-10-11 05:11:05 +08:00
Asset Size
262.output.js 2.84 KiB [emitted]
output.js 10.1 KiB [emitted] [name: main]
2017-05-10 19:15:14 +08:00
Entrypoint main = output.js
2019-10-11 05:11:05 +08:00
chunk output.js (main) 372 bytes (javascript) 4.75 KiB (runtime) [entry] [rendered]
2019-01-25 20:15:22 +08:00
> ./example.js main
2019-10-11 05:11:05 +08:00
./example.js + 2 modules 272 bytes [built]
2018-05-07 18:36:38 +08:00
[no exports]
2019-10-11 05:11:05 +08:00
[no exports used]
2019-02-05 01:52:39 +08:00
entry ./example.js main
2019-10-11 05:11:05 +08:00
./node_modules/shared.js + 1 modules 100 bytes [built]
2018-09-26 05:13:58 +08:00
[exports: x, y]
[all exports used]
2019-10-11 05:11:05 +08:00
harmony side effect evaluation shared ./example.js + 2 modules ./node_modules/a.js 3:0-23
harmony export imported specifier shared ./example.js + 2 modules ./node_modules/a.js 3:0-23
harmony side effect evaluation shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
harmony export imported specifier shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
harmony export imported specifier shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
+ 6 hidden chunk modules
chunk 262.output.js 273 bytes [rendered]
2019-05-10 03:34:28 +08:00
> ./lazy ./example.js 4:0-16
2019-10-11 05:11:05 +08:00
./lazy.js + 2 modules 231 bytes [built]
2019-05-10 03:34:28 +08:00
[exports: c, d, x, y]
2019-10-11 05:11:05 +08:00
import() ./lazy ./example.js + 2 modules ./example.js 4:0-16
./node_modules/cjs.js 42 bytes [built]
2019-05-10 03:34:28 +08:00
[only some exports used: c]
2019-10-11 05:11:05 +08:00
harmony side effect evaluation cjs ./lazy.js + 2 modules ./node_modules/c.js 2:0-29
harmony import specifier cjs ./lazy.js + 2 modules ./node_modules/c.js 4:35-47
2017-05-10 19:15:14 +08:00
```
2017-12-14 17:58:03 +08:00
## Production mode
2017-05-10 19:15:14 +08:00
```
2017-12-14 17:58:03 +08:00
Hash: 0a1b2c3d4e5f6a7b8c9d
2019-10-28 21:09:53 +08:00
Version: webpack 5.0.0-beta.1
2019-10-11 05:11:05 +08:00
Asset Size
262.output.js 265 bytes [emitted]
output.js 1.87 KiB [emitted] [name: main]
2017-05-10 19:15:14 +08:00
Entrypoint main = output.js
2019-10-11 05:11:05 +08:00
chunk output.js (main) 372 bytes (javascript) 4.75 KiB (runtime) [entry] [rendered]
2019-01-25 20:15:22 +08:00
> ./example.js main
2019-10-11 05:11:05 +08:00
./example.js + 2 modules 272 bytes [built]
[no exports]
[no exports used]
entry ./example.js main
./node_modules/shared.js + 1 modules 100 bytes [built]
[exports: x, y]
[all exports used]
2019-10-28 21:09:53 +08:00
harmony side effect evaluation shared ./example.js + 2 modules ./node_modules/a.js 3:0-23
harmony export imported specifier shared ./example.js + 2 modules ./node_modules/a.js 3:0-23
2019-10-11 05:11:05 +08:00
harmony side effect evaluation shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
harmony export imported specifier shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
harmony export imported specifier shared ./lazy.js + 2 modules ./node_modules/c.js 6:0-30
+ 6 hidden chunk modules
chunk 262.output.js 273 bytes [rendered]
2019-05-10 03:34:28 +08:00
> ./lazy ./example.js 4:0-16
2019-10-11 05:11:05 +08:00
./lazy.js + 2 modules 231 bytes [built]
[exports: c, d, x, y]
import() ./lazy ./example.js + 2 modules ./example.js 4:0-16
./node_modules/cjs.js 42 bytes [built]
[only some exports used: c]
harmony side effect evaluation cjs ./lazy.js + 2 modules ./node_modules/c.js 2:0-29
harmony import specifier cjs ./lazy.js + 2 modules ./node_modules/c.js 4:35-47
2017-05-10 19:15:14 +08:00
```