Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Webpack loader to load HTML as packed template content

License

Notifications You must be signed in to change notification settings

krutoo/html-to-template-loader

Repository files navigation

<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:

// use loader inline or place to your webpack module.rules
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 local fonts

About

Webpack loader to load HTML as packed template content

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages