0.0.5 • Published 3 years ago
release-version-webpack-plugin v0.0.5
ReleaseVersionWebpackPlugin
A webpack plugin for automatic log current release commit hash and version from package.json.
Feature
- Support different Webpack & html-webpack-plugin version
- webpack 3 & html-webpack-plugin 3
- webpack 4 & html-webpack-plugin 3
- webpack 5 & html-webpack-plugin 4/5
- Support custom release log format
- Support different type of file inject
- .html
- .css
- .js
Installation
# use npm
npm i release-version-webpack-plugin
# use yarn
yarn add release-version-webpack-plugin
Usage
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}
.