1.0.3 • Published 6 years ago

html-to-template-loader v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

<html> to <template> webpack loader

Create template from static html files with inline styles.

Make <web-components> instead of <iframes>!

Installation

Install with npm

npm install --save-dev html-to-template-loader

Usage

Import html to use in your custom element:

import templateHTML from 'html-to-template-loader!../html/banner.html';

const template = document.createElement('template');
template.innerHTML = templateHTML;

export class TopBanner extends HTMLElement {
    constructor () {
        // use your template...
    }
}

To Do

  • auto generate base64 from paths to local images
  • auto generate base64 from paths to localc fonts