Skip to content

Preserve star exports for externalized dependencies in module output #15270

@dzearing

Description

@dzearing

Bug report

What is the current behavior?
When code contains exports from externalized libraries, the export statements are not preserved in output when they should be.

If the current behavior is a bug, please provide the steps to reproduce.
Simple isolated repro (with details in the README): https://github.com/dzearing/test-webpack-esm

We bundle a simple entry point which contains:

export * from '@fluentui/utilities';

We turn on output.library.type="module" in the webpack config and mark the library as external. The bundle preserved should still emit the export. Instead it contains a bunch of unexpected content:

import*as e from"@fluentui/utilities";var r={d:(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};r.d({},{});

What is the expected behavior?
The output should match the input and export * from the library.

webpack version: 5.67.0
Node.js version: 16.13.1
Operating System: Windows 11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions