Skip to content

Duplicate exports via export * which map to the same externalized implementation disappear from output #2658

Description

@dzearing

Repro (not this is not specific to a library, just using my case as an example):

index.js: export * from './path1.js'; export * from './path2.js';
path1.js: export { DateTime } from '@fluentui/date-time-utilities';
path2.js: export { DateTime } from '@fluentui/date-time-utilities';

In this setup, the single index barrel file exports both path1 and path2. Each of them export a single named export from a library. This does mean that DateTime is exported twice, but resolves to the same symbolic representation.

This works fine in a normal bundle, but when the library is externalized, this export disappears completely.

Expected:

Running this:

esbuild index.js --bundle --external:@fluentui/date-time-utilities --format=esm --outdir=dist2

Should emit this in the output:

export { DateTime } from '@fluentui/date-time-utilities';

Repros with 0.15.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions