Skip to content

Commit

Permalink
fix(plugging): import relative paths from origin
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-d committed Feb 10, 2023
1 parent d3b745a commit e268869
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mixins/Plugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ export function Plugging<TBase extends LitElementConstructor>(Base: TBase) {
if (this.loadedPlugins.has(tagName)) return;
this.#loadedPlugins.set(tagName, plugin);
if (customElements.get(tagName)) return;
import(plugin.src).then(mod =>
customElements.define(tagName, mod.default)
);
const url = new URL(plugin.src, window.location.href).toString();
import(url).then(mod => customElements.define(tagName, mod.default));
})
);

Expand Down

0 comments on commit e268869

Please sign in to comment.