🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

rollup-plugin-minify-html-literals-v3

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-minify-html-literals-v3

Rollup plugin to minify HTML template literal strings, supports Rollup v3

1.3.4
latest
Source
npm
Version published
Weekly downloads
456
-10.59%
Maintainers
1
Weekly downloads
 
Created
Source

Notice

This is a fork of the official repository rollup-plugin-minify-html-literals because the Rollup dependency version remains at v2, so this repository serves as a temporary fix.

Once the official repository is upgraded to v3, this repository will be archived.

Upgraded to Rollup v4, only need to synchronize types, no code changes.

Install

npm i rollup-plugin-minify-html-literals-v3 -D

Usage

rollup.config.js

import minifyLiterals from 'rollup-plugin-minify-html-literals-v3';

export default {
  ...
  plugins: [minifyLiterals()],
};

Configuration

minifyLiterals({
  // minimatch of files to minify
  include: [],
  // minimatch of files not to minify
  exclude: [],
  // set to `true` to abort bundling on a minification error
  failOnError: false,
  // minify-html-literals options
  // https://www.npmjs.com/package/minify-html-literals#options
  options: null,
  // Advanced Options
  // Override minify-html-literals function
  minifyHTMLLiterals: null,
  // Override rollup-pluginutils filter from include/exclude
  filter: null
});

options

PropertyTypeDefaultDescription
fileNamestringRequired. The name of the file, used for syntax parsing and source maps.
minifyOptions?html-minifier optionsdefaultMinifyOptionsDefaults to production-ready minification.
minifyOptions?.minifyCSS?clean-css optionsdefaultMinifyCSSOptionsUses clean-css defaults.
shouldMinify?functiondefaultShouldMinifyA function that determines whether or not an HTML template should be minified. Defaults to minify all tagged templates whose tag name contains "html" (case insensitive).
shouldMinifyCSS?functiondefaultShouldMinifyCSSA function that determines whether or not a CSS template should be minified. Defaults to minify all tagged templates whose tag name contains "css" (case insensitive).

Advanced Options

For more detailed configuration, go to minify-html-literals.

Keywords

rollup-plugin

FAQs

Package last updated on 19 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts