I have defined a custom element and I want to execute a script only when the custom element is upgraded to its registered type. The use case is that I must call a custom met
Load the dependency via an import in your custom element module. For example, a custom element module (e.g.something.mjs) which depends on Highcharts:
import
something.mjs
import '/node_modules/highcharts/highcharts.js' class Something extends HTMLElement {} customElements.define('x-something', Something)