Enables ES 2015 imports for Blaze templates using the <component>
tag.
Normal Blaze template are unaffected (you can use both in the same project).
meteor remove blaze-html-templates
meteor add nathantreid:blaze-modules
component1.html
component2.html
component1.js
import component1 from './component1.html';
import component2 from './component2.html';
component1.helpers({ component2 });
The first component in the file is exported as the default as well as by name; all other components and templates are exported by name:
components.html
components.js
import theFirstComponent, { a_component, another_component }_ from './components.html';
// theFirstComponent === a_component // is true
All components below a given template or component in the same file are automatically added as helpers to that template: components.html
components.js
import a_component from './components.js';
// no helpers statement or import of the second component necessary, this code is automatically added by the compiler:
/*
a_component.helpers({ another_component });
*/