open-wc / custom-elements-manifest-deprecated

Custom Elements Manifest is a file format that describes custom elements in your project.
8 stars 4 forks source link

improve window.customElements.define #37

Closed thepassle closed 3 years ago

thepassle commented 3 years ago

Currently only customElements.define is picked up as a export of kind "custom-elements-definition". We should also pick up window.customElements.define.

It now naively handles window.customElements.define, but it would be nice to implement the helper code lars mentioned

LarsDenBakker commented 3 years ago

We have some helper code in the HMR plugin to lookup the reference path, so that you can even handle a reassigned custom element registry:

const x = window.customElements;

x.define('x-foo', XFoo);