Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

semver-extended-webpack-plugin

1.3.0 • Public • Published

semver-extended-webpack-plugin

A webpack plugic to do semver

Archives

Features

  • Bump up version using function semver.inc fields in json files, ex: package.json, bower.json
  • Support command line arguments or config
  • Enable/disable by arguments
  • Console update (see options)
  • Add buildDate (see options)

Installation

npm install semver-extended-webpack-plugin --save-dev

Webpack example

  • webpack.config.js
var SemverWebpackPlugin = require('semver-extended-webpack-plugin');
 
module.exports = {
  plugins: [
      new SemverWebpackPlugin({
        files: [path.resolve(__dirname, 'package.json')],
        incArgs: ['patch'],
        console: true,
        buildDate: true,
        version: '1.8'  // optional if you want to set the desired version
      })
    ]
}

Usage

Webpack config

new SemverWebpackPlugin({options})
Options Properties
files list of input files, should are absolute paths
incArgs arguments will be passed to function semver.inc(), see node-semver
console show console output of version update (default: false)
buildDate add buildDate key to package.json (default: false)
version set version to a specific version (default: null)

Arguments

  • --semver-extended-webpack-plugin-inc-args arguments passed to function semver.inc (in csv format), ex: webpack --semver-extended-webpack-plugin-inc-args=prelease,beta
  • --semver-extended-webpack-plugin-disable this is useful to bumpup version in sometime, see example section above for more info
    • true then the Plugin will not run
    • Default is false

License

http://www.opensource.org/licenses/mit-license.php

Credits

semver-extended-webpack-plugin written by Mike Erickson

E-Mail: codedungeon@gmail.com

Twitter: @codedungeon

Website: codedungeon.org

Additional Attribution:

semver-webpack-plugin

install

npm i semver-extended-webpack-plugin

Downloadsweekly downloads

23

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar