Skip to content

Commit

Permalink
fix: corrected webpack transpiling issue and added existing custom el…
Browse files Browse the repository at this point in the history
…ement check
  • Loading branch information
ncoonrod committed May 25, 2022
1 parent e7c7be7 commit d0c48d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/HotStaq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ export class HotStaq implements IHotStaq
if ((component.tag == null) || (component.tag === ""))
throw new Error (`Component ${component.name} must have a tag!`);

if (customElements.get (component.tag) !== undefined)
{
/// @fixme This element has already been defined. Should this throw an error or warning? I don't think it should...

return;
}

customElements.define (component.tag, class extends HTMLElement
{
constructor ()
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
loader: "ts-loader",
options: {
transpileOnly: true,
configFile: "tsconfig.json"
configFile: "tsconfig-web.json"
}
}],
exclude: new RegExp ("node_modules")
Expand Down

0 comments on commit d0c48d3

Please sign in to comment.