Skip to content

Commit 2804f35

Browse files
Update README.md
1 parent ee2b47c commit 2804f35

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/harmony-unused/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
This example demonstrates how webpack tracks the using of ES6 imports and exports. Only used exports are emitted to the resulting bundle. The minimizing step than removes the declarations because they are ununsed.
1+
This example demonstrates how webpack tracks the using of ES6 imports and exports. Only used exports are emitted to the resulting bundle. The minimizing step then removes the declarations because they are ununsed.
22

3-
In this example only `add` and `multiply` in `./math.js` are used used by the app. `list` is unused and is not included in the minimized bundle (Look for `Array.from` in the minimized bundle).
3+
Excluding unused exports from bundles is known as "[tree-shaking](http://www.2ality.com/2015/12/webpack-tree-shaking.html)".
44

5-
In addition to that `library.js` simulates an entry point to a big library. `library.js` reexports multiple identifiers from submodules. Often big parts of that is unsed like `abc.js`. Here is visible how the usage information flows from `example.js` through `library.js` into `abc.js` and all declarations in `abc.js` are not included in the minimized bundle (Look for `console.log("a")` in the minimized bundle).
5+
In this example, only `add` and `multiply` in `./math.js` are used used by the app. `list` is unused and is not included in the minimized bundle (Look for `Array.from` in the minimized bundle).
6+
7+
In addition to that, `library.js` simulates an entry point to a big library. `library.js` re-exports multiple identifiers from submodules. Often big parts of that is unused, like `abc.js`. Note how the usage information flows from `example.js` through `library.js` into `abc.js` and all declarations in `abc.js` are not included in the minimized bundle (Look for `console.log("a")` in the minimized bundle).
68

79

810
# example.js
@@ -214,4 +216,4 @@ Side effects in initialization of unused variable __WEBPACK_IMPORTED_MODULE_0__a
214216
Dropping unused function a [./abc.js:1,0]
215217
Dropping unused function b [./abc.js:2,0]
216218
Dropping unused function c [./abc.js:3,0]
217-
```
219+
```

0 commit comments

Comments
 (0)