Skip to content

Commit

Permalink
Update src/content/configuration/optimization.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Chen <chenxsan@gmail.com>
  • Loading branch information
fi3ework and chenxsan authored Sep 26, 2024
1 parent 6f239ea commit 9f312b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/content/configuration/optimization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ W> If you are using webpack [CLI](/api/cli/), the webpack process will not exit

`boolean = false`

<Badge text="5.95.0+" />

Use `optimization.avoidEntryIife` to avoid wrapping the entry module in an IIFE when it is required (search for `"This entry need to be wrapped in an IIFE because"` in [JavascriptModulesPlugin](https://github.com/webpack/webpack/blob/main/lib/javascript/JavascriptModulesPlugin.js)). This approach helps optimize performance for JavaScript engines and enables tree shaking when building ESM libraries.

Currently, `optimization.avoidEntryIife` can only optimize a single entry module along with other modules.
Expand Down

0 comments on commit 9f312b2

Please sign in to comment.