Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created September 8, 2021 06:14
Show Gist options
  • Save YonatanKra/e1a00241db14bfbd7571f7b498972c16 to your computer and use it in GitHub Desktop.
Save YonatanKra/e1a00241db14bfbd7571f7b498972c16 to your computer and use it in GitHub Desktop.
<h1>Welcome to ${title}</h1>
import './app.element.scss';
import template from '!!raw-loader!./app.element.html';
export class AppElement extends HTMLElement {
public static observedAttributes = [];
connectedCallback() {
const title = 'My Component';
this.innerHTML = template.replace('${title}', title);
}
}
customElements.define('yonatan-root', AppElement);
declare module '!!raw-loader!*' {
const contents: string
export = contents
}
{
"compilerOptions": {
"types": ["raw-loader.d.ts", "node"],
"allowSyntheticDefaultImports": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment