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 bb50c7e
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: export a default expression's binding on demand (#22227)
* refactor: export a default expression's binding on demand
* fix(library): keep the export helpers where a module entry goes to the registry
The module library entry's export definitions are left out of its source and
handed over on demand, which only works where the renderer inlines the entry —
rendered into the module registry instead, the stashed source is put back and
reads the helpers again. The runtime requirements were dropped in both cases,
so a chunk whose entry is executed as a factory called `__webpack_require__.d`
and `.r` that the runtime no longer defined.
Ask what the renderer asks before dropping them: the startup inlines the entry
only when no other chunk of the entrypoint loads with it and no module reads
it, and a chunk whose runtime lives elsewhere lifts its entry to the top level
under the conditions `_getEsmEntryModuleToInline` already states — now a static
so the decision can be made before rendering.
* test(library): assert the entry exports both bindings from the registry
Rendered into the module registry, the entry has its export definitions put
back into the factory, and nothing held it to still exposing what they define.
---------
Co-authored-by: alexander-akait <[email protected]>
0 commit comments