A Rollup plugin to minify html template literals
import template from "rollup-plugin-html-literals";
export default {
input: "index.js",
output: { file: "dist/index.js", format: "esm" },
plugins: [ template() ]
};
This will minify any template literal that is tagged with html
.
NOTICE: This plugin should be used before transpiling.
Type: array
or string
Default: []
A single file, or array of files to include when minifying.
Type: array
or string
Default: []
A single file, or array of files to exclude when minifying.
Type: boolean
Default: false
If true, will throw an error if any errors were found.
Type: Object
Default: null
Specify options for minify-html-literals
Type: function
Default: null
Override the minification function.
Projects such as lit-html
make use of template literals, and in order to decrease bundle size,
you need to minify the html markup you write in those template literals. The current solution for Rollup, appears to be
rollup-plugin-minify-html-literals
but this plugin does not support newer versions of Rollup.
This plugin acts to solve the compatiblity issue, support newer versions of Rollup and maintain active support.
If you are having trouble getting something to work with this plugin or run into any problems, you can create a new Issue.
If this plugin does not fit your needs or is missing a feature you would like to see, let us know! We would greatly appreciate your feedback on it.
rollup-plugin-html-literals is licensed under the terms of the MIT license.