release-version-webpack-plugin
v0.0.5
Published
A webpack plugin for automatic log current release commit hash and version from package.json.
Readme
ReleaseVersionWebpackPlugin
A webpack plugin for automatic log current release commit hash and version from package.json.
Feature
- [ ] Support different Webpack & html-webpack-plugin version
- [x] webpack 3 & html-webpack-plugin 3
- [x] webpack 4 & html-webpack-plugin 3
- [ ] webpack 5 & html-webpack-plugin 4/5
- [ ] Support custom release log format
- [ ] Support different type of file inject
- [x] .html
- [ ] .css
- [ ] .js
Installation
# use npm
npm i release-version-webpack-plugin
# use yarn
yarn add release-version-webpack-pluginUsage
import ReleaseVersionWebpackPlugin from 'release-version-webpack-plugin'
config.plugins.push(new ReleaseVersionWebpackPlugin())By default, ReleaseVersionWebpackPlugin will inject a script to your entry html like this:
<script>
console.log("env: PRODUCT", "dfae3d@2020-12-28 18:02:43")
<script>the default format is env: ${NODE_ENV} ${latest commit hash}@${latest build time}.
