investigate requirement of needing a default export
for rendering entry points
#23
Labels
Projects
Milestone
Type of Change
Summary
Currently,
wcc
requires adefault export
from the first entry point custom element definition it parses.For example, is you do this
wcc
will throw this errorfile:///Users/owenbuckley/Workspace/github/repos/wcc/src/wcc.js:80 const elementInstance = new element(data); // eslint-disable-line new-cap ^ TypeError: element is not a constructor at initializeCustomElement (file:///Users/owenbuckley/Workspace/github/repos/wcc/src/wcc.js:80:27) at async renderToString (file:///Users/owenbuckley/Workspace/github/repos/wcc/src/wcc.js:99:27) at async init (file:///Users/owenbuckley/Workspace/github/repos/wcc/build.js:38:22)
Details
Maybe it's because this doesn't call
customElements.define
, so we have no way to know the name? Perhaps that's the tradeoffSomewhat related, we should better handle the case where you use a custom element, but not
import
itwhich will casue
wcc
to throw this errorThe text was updated successfully, but these errors were encountered: