Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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