Skip to content

Commit ffd9346

Browse files
rlubaEugeneHlushko
authored andcommitted
Document that concatenation is enabled by default (#2505)
1 parent c7f2fd8 commit ffd9346

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/content/plugins/module-concatenation-plugin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ related:
1010

1111
In the past, one of webpack’s trade-offs when bundling was that each module in your bundle would be wrapped in individual function closures. These wrapper functions made it slower for your JavaScript to execute in the browser. In comparison, tools like Closure Compiler and RollupJS ‘hoist’ or concatenate the scope of all your modules into one closure and allow for your code to have a faster execution time in the browser.
1212

13-
This plugin will enable the same concatenation behavior in webpack.
13+
This plugin will enable the same concatenation behavior in webpack. By default this plugin is already enabled in [production `mode`](/concepts/mode/#mode-production) and disabled otherwise. If you need it in other modes, you can add it manually:
1414

1515
```js
1616
new webpack.optimize.ModuleConcatenationPlugin();
1717
```
1818

19+
1920
> This concatenation behavior is called “scope hoisting.”
2021
>
2122
> Scope hoisting is specifically a feature made possible by ECMAScript Module syntax. Because of this webpack may fallback to normal bundling based on what kind of modules you are using, and [other conditions](https://medium.com/webpack/webpack-freelancing-log-book-week-5-7-4764be3266f5).

0 commit comments

Comments
 (0)