Skip to content

Instantly share code, notes, and snippets.

@dorward
Created November 28, 2015 16:40
Show Gist options
  • Save dorward/769167498c4f63cdf34d to your computer and use it in GitHub Desktop.
Save dorward/769167498c4f63cdf34d to your computer and use it in GitHub Desktop.
I wish ES6 supported dynamic module loading. Then I might not feel the need to do this.
// Load all the modules.
// ES6 doesn't support dynamic module loading, so we can't just pull these from files. They have to be hard coded.
{{#modules}}
import * as {{name}} from "./seq/{{name}}.js";
{{/modules}}
import {List} from 'immutable';
export function loadModules() {
return new List([
{{#modules}}
{{name}}{{#unless @last}},{{/unless}}
{{/modules}}
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment