1.0.1 • Published 8 years ago

babel-plugin-html-template v1.0.1

Weekly downloads
15
License
MIT
Repository
github
Last release
8 years ago

babel-plugin-html-template

A plugin for Babel 6 that removes whitespace and minifies html written using template strings.

Installation

$ npm install babel-plugin-html-template --save-dev
$ babel --plugins html-template script.js

Important

This plugin needs to be run before transform-es2015-template-literals.

Usage

All template strings tagged with the html tag will be minified and all unneeded white-space will be removed.

For instance:

let html = html`
	<div>
		<section class="awesome">hi there!</section>
	</div>
`;

becomes:

var html = "<div><section class=\"awesome\">hi there!<\/section><\/div>"

License

Copyright (c) 2016 Dlmma IVS. Released under the MIT license.