Skip to content

Instantly share code, notes, and snippets.

@ultimatemonty
Created January 31, 2019 15:06
Show Gist options
  • Select an option

  • Save ultimatemonty/5e0d676ba02cb67314ce905c8f99272b to your computer and use it in GitHub Desktop.

Select an option

Save ultimatemonty/5e0d676ba02cb67314ce905c8f99272b to your computer and use it in GitHub Desktop.

Revisions

  1. Chris McCuller created this gist Jan 31, 2019.
    6 changes: 6 additions & 0 deletions import-stuff.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    // A, B, G are undefined when trying to reference them
    import { A, B, G } from 'module-b';

    // A, B, G are defined properly
    import * as Stuff from 'module-b';
    const { A, B, G } = Stuff;
    17 changes: 17 additions & 0 deletions module-a.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // module-a/index.js
    import A from './a';
    import B from './b';
    import C from './c';
    import D from './d';
    import E from './e';
    import F from './e';


    export {
    A,
    B,
    C,
    D,
    E,
    F
    };
    10 changes: 10 additions & 0 deletions module-b.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    // module-b/index.js
    import * as Things from 'module-a';
    import G from './g';

    const stuff = {
    ...Things,
    G
    };

    export default stuff;