GithubHelp home page GithubHelp logo

ryanhmasten / semver-webpack-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phuonghuynh/semver-webpack-plugin

0.0 1.0 0.0 8 KB

A webpack plugic to do semver

License: MIT License

JavaScript 100.00%

semver-webpack-plugin's Introduction

semver-webpack-plugin

A webpack plugic to do semver

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
  • More comming...

Dependencies

These dependencies should be installed via npm

  • semver latest
  • command-line-args latest

Installation

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

Webpack example

  • webpack.config.js
var SemverWebpackPlugin = require('semver-webpack-plugin');

module.exports = {
  plugins: [
      new SemverWebpackPlugin({
        files: [path.resolve(__dirname, "package.json")]
      })
    ]
}
  • Gruntfile.js
  grunt.initConfig({
    webpack: {
      build: webpackConfig
    }
  });
  • package.json
{
  "scripts": {
    "build": "grunt build --semver-webpack-plugin-disable",
    "dev": "webpack-dev-server --progress --colors",
    "build-major": "grunt build --semver-webpack-plugin-inc-args=major",
    "build-minor": "grunt build --semver-webpack-plugin-inc-args=minor",
    "build-beta": "grunt build --semver-webpack-plugin-inc-args=prerelease,beta"
  },
  "devDependencies": {
    "clean-webpack-plugin": "latest",
  }
}

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

Arguments

  • --semver-webpack-plugin-inc-args arguments passed to function semver.inc (in csv format), ex: webpack --semver-webpack-plugin-inc-args=prelease,beta
  • --semver-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

semver-webpack-plugin's People

Contributors

phuonghuynh avatar ryanhmasten avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.