It's not clear if this behaviour is part of this proposal. If it is not currently a part of it, its syntax could look something like:
This is useful because export * will not include any default exports and export * as v forces us to do this ugliness:
import v from "mod";
v.default();
The Goal
app.mjs:
import { CONSTANT_A, CONSTANT_B, funcA, funcB } from 'package';
funcA(CONSTANT_A);
funcB(CONSTANT_B);
package-index.mjs:
export funcA, * from './package-funcA.mjs';
export funcB, * from './package-funcB.mjs';
package-funcA.mjs:
export default arg => arg;
export CONSTANT_A = 'value-a';
package-funcB.mjs:
export default arg => arg;
export CONSTANT_B = 'value-b';
It's not clear if this behaviour is part of this proposal. If it is not currently a part of it,its syntax could look something like:This is useful because
export *will not include any default exports andexport * as vforces us to do this ugliness:The Goal
app.mjs:
package-index.mjs:
package-funcA.mjs:
package-funcB.mjs: