https://github.com/afeiship/semver-webpack-plugin
Semver webpack plugin.
https://github.com/afeiship/semver-webpack-plugin
bump plugin semver version webpack
Last synced: 6 months ago
JSON representation
Semver webpack plugin.
- Host: GitHub
- URL: https://github.com/afeiship/semver-webpack-plugin
- Owner: afeiship
- License: mit
- Created: 2018-07-31T10:09:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-17T10:34:52.000Z (almost 5 years ago)
- Last Synced: 2025-03-17T22:55:49.590Z (7 months ago)
- Topics: bump, plugin, semver, version, webpack
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# semver-webpack-plugin
> Semver webpack plugin[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/semver-webpack-plugin
```## usage:
```js
import SemverWebpackPlugin from '@jswork/semver-webpack-plugin';// plugins:
plugiins:[
new SemverWebpackPlugin({ enabled: true })
]
```## options:
| Name | Type | Default | Description |
| -------- | -------- | ---------------------------------------- | ---------------------- |
| files | Array | ['./package.json'] | Default files array. |
| enabled | Boolean | true | If enable this plugin. |
| callback | Function | semver.inc(inValue, 'prepatch','alpha'); | See `semver` |## development callback:
```conf
## oldVersion: 1.0.0
## newVersion: 1.0.1-alpha.0
```
```js
// semver.inc('1.0.0', 'prerelease','alpha')
function(inVersion){
return this.inc(inVersion, 'prerelease','alpha');
}
```## production callback:
```conf
## oldVersion: 1.0.1-alpha.30
## newVersion: 1.0.1
```
```js
// semver.valid( semver.coerce('1.0.1-alpha.30') )
function(inVersion){
return this.valid(
this.coerce(inVersion)
);
}```
## license
Code released under [the MIT license](https://github.com/afeiship/semver-webpack-plugin/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/semver-webpack-plugin
[version-url]: https://npmjs.org/package/@jswork/semver-webpack-plugin[license-image]: https://img.shields.io/npm/l/@jswork/semver-webpack-plugin
[license-url]: https://github.com/afeiship/semver-webpack-plugin/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/semver-webpack-plugin
[size-url]: https://github.com/afeiship/semver-webpack-plugin/blob/master/dist/semver-webpack-plugin.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/semver-webpack-plugin
[download-url]: https://www.npmjs.com/package/@jswork/semver-webpack-plugin