Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@vxna/mini-html-webpack-template
Advanced tools
Template for mini-html-webpack-plugin that extends default features with useful subset of options
It does not work with html-webpack-plugin
webpack.config.js
const MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')
module.exports = {
plugins: [
new MiniHtmlWebpackPlugin({
context: {
title: 'common-usage',
favicon: 'https://assets-cdn.github.com/favicon.ico',
container: 'root',
trimWhitespace: true
},
template: require('@vxna/mini-html-webpack-template')
})
]
}
Name | Type | Default | Description |
---|---|---|---|
lang | {String} | undefined | Set document language |
title | {String} | 'sample-app' | Set document title |
favicon | {String} | undefined | Set document favicon |
container | {String} | undefined | Set application mount point |
trimWhitespace | {Boolean} | undefined | Safe document whitespace reduction |
webpack.config.js
const MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')
module.exports = {
plugins: [
new MiniHtmlWebpackPlugin({
context: {
title: 'extended-usage',
head: {
meta: [
{
name: 'description',
content: 'mini-html-webpack-template'
},
{
property: 'og:description',
content: 'mini-html-webpack-template'
}
],
links: [
{
rel: 'icon',
type: 'image/x-icon',
href: 'https://assets-cdn.github.com/favicon.ico'
}
]
},
body: {
raw: '<div id="root"></div>'
}
},
template: require('@vxna/mini-html-webpack-template')
})
]
}
Name | Type | Default | Description |
---|---|---|---|
head.meta | {Array} | undefined | Array of objects with key + value pairs |
head.links | {Array} | undefined | Array of objects with key + value pairs |
head.scripts | {Array} | undefined | Array of objects with key + value pairs |
head.raw | {Array|String} | undefined | Raw document markup |
body.scripts | {Array} | undefined | Array of objects with key + value pairs |
body.raw | {Array|String} | undefined | Raw document markup |
For custom needs html-minifier middleware and all of it's options could be used
webpack.config.js
const { minify } = require('html-minifier')
const MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')
module.exports = {
plugins: [
new MiniHtmlWebpackPlugin({
context: {
title: 'extended-minification'
},
template: ctx =>
minify(require('@vxna/mini-html-webpack-template')(ctx), {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true
})
})
]
}
FAQs
Minimum viable template for mini-html-webpack-plugin
The npm package @vxna/mini-html-webpack-template receives a total of 39,370 weekly downloads. As such, @vxna/mini-html-webpack-template popularity was classified as popular.
We found that @vxna/mini-html-webpack-template 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.