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.
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
indexbarrel file exports bothpath1andpath2. Each of them export a single named export from a library. This does mean thatDateTimeis 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:
Should emit this in the output:
Repros with 0.15.13.