Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
rollup-plugin-html-string
Advanced tools
Rollup plugin for loading content of HTML files to use as string variable in JavaScript code.
npm install --save-dev rollup-plugin-html-string
import htmlString from 'rollup-plugin-html-string';
export default {
input: 'main.js',
plugins: [
htmlString({
include: '**/*.html'
})
],
output: {
dir: 'dist',
},
}
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.
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.
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',
},
}
MIT
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.
FAQs
Rollup plugin to import HTML files as string
The npm package rollup-plugin-html-string receives a total of 0 weekly downloads. As such, rollup-plugin-html-string popularity was classified as not popular.
We found that rollup-plugin-html-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.