
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
html-webpack-format-plugin
Advanced tools
格式化由underscore-template-loader等模板系统生成的html代码,让html-webpack-plugin输出的Html文件更加美观
将 HTML Webpack Plugin 输出的 html 文件格式化 参考: rehypejs/rehype-format 对格式逻辑做了些修改
在 Webpack 中使用
var HtmlWebpackFormatPlugin = require('html-webpack-format-plugin')
添加到插件列表
plugins: [new HtmlWebpackPlugin(), new HtmlWebpackFormatPlugin()]
HtmlWebpackPlugin 之前输出的文件
<!DOCTYPE html>
<html>
<head>
<title>Hello!</title>
<meta charset="utf8" />
</head>
<body>
<!-- body/section.html -->
<section><p>hi there</p></section>
</body>
</html>
使用此插件之后输出的 html 文件
<!DOCTYPE html>
<html>
<head>
<title>Hello!</title>
<meta charset="utf8" />
</head>
<body>
<!-- body/section.html -->
<section>
<p>hi there</p>
</section>
</body>
</html>
HtmlWebpackFormatPlugin(options)Format white-space in the processed tree.
All superfluous white-space is removed. However, as newlines are kept (and later properly indented), your code will still line-wrap as expected.
optionsoptions.indentnumber, string, default: 2
— Indentation per level. When number, uses that amount of spaces. When
string, uses that per indentation level.
options.indentInitialboolean, default: true
— Whether to indent the first level (usually, in the html element, thus
not indenting head and body).
options.blanksArray.<string>, default: []
— List of tag-names, which, when next to each other, are joined by a blank
line (\n\n). For example, when ['head', 'body'] is given, a blank line
is added between these two.
rehype-minify
— Minify HTML
rehypejs/rehype-format — Modified from rehypejs/rehype-format
FAQs
格式化由underscore-template-loader等模板系统生成的html代码,让html-webpack-plugin输出的Html文件更加美观
We found that html-webpack-format-plugin 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.