A plugin for Babel 6 that removes whitespace and minifies html written using template strings.
$ npm install babel-plugin-html-template --save-dev
$ babel --plugins html-template script.js
This plugin needs to be run before transform-es2015-template-literals
.
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>"
Copyright (c) 2016 Dlmma IVS. Released under the MIT license.