Skip to content

Export all named and default as name #10

@stevenvachon

Description

@stevenvachon

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:

export v, * from "mod";

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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions