Consider this example:
// entrypoint.js
import { foo } from "./a.js";
// a.js
export * from "./b.js";
// b.js
export defer { foo } from "./foo.js";
export defer { bar } from "./bar.js";
Will it load bar.js? We have two possible answers:
- Yes:
export * from is loading all the bindings from ./b.js, so it's loading bar. It's equivalent to export { foo, bar } from
- No: The
bar binging is not actually listed anywhere. Deferred re-exports are only loaded when the relative binding is explicitly present in a { ... } from list.
Consider this example:
Will it load
bar.js? We have two possible answers:export * fromis loading all the bindings from./b.js, so it's loadingbar. It's equivalent toexport { foo, bar } frombarbinging is not actually listed anywhere. Deferred re-exports are only loaded when the relative binding is explicitly present in a{ ... } fromlist.