@guangze233/version-webpack-plugin
v0.0.1
Published
append version in html
Readme
html 追加版本号
options
| 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | path | html 路径 | string | dist/index.html | | version | 版本号 | string | version in pakcage.json | | datetime | 打包时间 | boolean | true | | timestamp | 打包时间戳 | boolean | false | | http2https | http 转 https | boolean | false | | callback | custom full VersinName | Function | |
require
[version-webpack-plugin] require Node.js 16 or newer
install
npm i @guangze233/version-webpack-plugin -Ddemo
const VersionWebpackPlugin = require("@guangze233/version-webpack-plugin")
new VersionWebpackPlugin({
path: 'dist/index.html',
version: "",
http2https: true,
datetime: false,
timestamp: false,
callback: () => {
return 'custome_version_info_by_callback'
}
})dist/index.html
<!DOCTYPE html>
<html>
<head>
<meta name="version" content="custome_version_info_by_callback"/>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"/>
<title>@guangze233/version-webpack-plugin</title>...