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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    0
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i html-to-template-loader

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

5.83 kB

Total Files

7

Last publish

Collaborators

  • krutoo