webpack-appversion-plugin
v1.2.1
Published
Webpack plugin which adds version information to project
Downloads
32
Readme
Webpack Appversion Plugin
This is a webpack plugin that automatically displays version number in web application
Installation
Install the plugin with npm:
$ npm install webpack-appversion-plugin --save
or Yarn:
$ yarn add webpack-appversion-plugin
Basic Usage
The plugin will add version box to your application by prepending code to given entry points
var WebpackAppversionPlugin = require('webpack-appversion-plugin');
var webpackConfig = {
entry: {
main: './src/main.js'
},
output: {
path: 'dist',
filename: 'index_bundle.js'
},
plugins: [
new WebpackAppversionPlugin({
entries: ['main'],
version: '1.0.0',
})
]
};
Configuration
You can pass configuration options to WebpackAppversionPlugin
.
Allowed values are as follows:
entries
: an array of webpack's entry points which should contain plugin's codeversion
: a string that will be displayed as versiontheme
:'light' | 'dark'
(default:'light'
) color scheme of version boxwrapperStyle
:{}
allows to overwrite version box stylesisOpen
:true | false
(default:false
) determines whether box should be displayed open or closed as default
Here's an example webpack config illustrating how to use these options:
{
entries: ['main'],
version: '1.0.0',
theme: 'dark',
wrapperStyle: { fontSize: '20px', top: 'auto', bottom: '0' },
isOpen: true
}