Skip to content

Preserve star exports for externalized dependencies in module output #15270

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

webpack-5Concerns the webpack 5 line

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions