Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-html-string

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-html-string

Rollup plugin to import HTML files as string

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-html-string

Build Status

Rollup plugin for loading content of HTML files to use as string variable in JavaScript code.

Installation

npm install --save-dev rollup-plugin-html-string

Usage

import htmlString from 'rollup-plugin-html-string';

export default {
	input: 'main.js',
	plugins: [
		htmlString({
			include: '**/*.html'
		})
	],
	output: {
		dir: 'dist',
	},
}

Options

include

Type: array, string or regexp Default: **/*.html

A single file pattern, or an array of file patterns to include when importing html files. For more details see rollup-pluginutils.

exclude

Type: array, string or regexp Default: undefined

A single file pattern, or an array of file patterns to exclude when importing html files. For more details see rollup-pluginutils.

htmlMinifierOptions

Type: Object Default: {}

The options which are given to html-minifier

For example:

import htmlString from 'rollup-plugin-html-string';

export default {
	entry: 'main.js',
	plugins: [
		html({
			htmlMinifierOptions: {
				collapseWhitespace: true,
				collapseBooleanAttributes: true,
				conservativeCollapse: true,
				minifyJS: true
			}
		})
	],
	output: {
		dir: 'dist',
	},
}

License

MIT

Credits

This plugin is forked from rollup-plugin-html written by Adam Beres-Deak (@bdadam).

He thanks Bogdan Chadkin (@TrySound) for his rollup-plugin-string rollup plugin which he used as the basis for this plugin.

Keywords

FAQs

Package last updated on 29 Jan 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc