Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

html-to-template-loader

1.0.3 • Public • Published

<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

Keywords

none

Install

npm i html-to-template-loader

DownloadsWeekly Downloads

6

Version

1.0.3

License

MIT

Unpacked Size

5.83 kB

Total Files

7

Last publish

Collaborators

  • avatar