You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a4dc34f
Browse filesBrowse the repository at this point in the historyBrowse files
fix: expose exports of all entry modules in library output
When an entry is an array of modules and a library output is configured,
only the exports of the last entry module were flagged as used and
exposed on the library. Exports of all earlier entry modules were
tree-shaken away and silently dropped.
The fix stays entirely in the library plugin layer:
- AbstractLibraryPlugin gains an opt-in finishAllEntryModules mode that
flags the exports of every entry dependency as used, and a helper that
renders startup code merging the exports of all entry modules of the
chunk into the final library exports object. Later entry modules win
on export name conflicts, preserving the documented last-entry-wins
semantics. Merging is skipped when startup is delayed by depending
chunks or when entry modules are inlined.
- AssignLibraryPlugin (var, assign, this, window, self, global,
commonjs, commonjs2) and ExportPropertyLibraryPlugin (amd, umd,
system, jsonp) opt in.
- module/modern-module and commonjs-static keep their current behavior,
since their export lists are generated statically from the last entry
module.
Fixes#15936
Expose exports of all entry modules in library output when an entry is an array of modules, instead of only the last entry module's exports (fixes #15936)
* @property {string} pluginName name of the plugin
42
43
* @property {LibraryType} type used library type
44
+
* @property {boolean=} finishAllEntryModules when true, finishEntryModule is called for every entry dependency instead of only the last one, so exports of all entry modules survive optimization
0 commit comments