@constgen/neutrino-revision
v1.9.2
Published
Neutrino middleware for versioning of the application based on the Git revision
Downloads
8
Maintainers
Readme
@constgen/neutrino-revision
Neutrino middleware that exposes Git revision information through environment variables
Features
- Git revision information through environment variables:
VERSION
,COMMITHASH
,BRANCH
- Correctly handle CI/CD environments
- Create files in the output with the revision information
- Fallback
VERSION
to package.json"version"
in non-Git environment
Requirements
- Node.js v10+
- Neutrino v9
- Webpack v4
Installation
@constgen/neutrino-revision
can be installed from NPM. You should install it to "dependencies"
(--save) or "devDependncies"
(--save-dev) depending on your goal.
npm install --save @constgen/neutrino-revision
Usage
In preset
Require this package and plug it into Neutrino. The middleware has no options:
let revision = require('@constgen/neutrino-revision')
neutrino.use(revision())
In neutrinorc
The middleware also may be used together with another presets in Neutrino rc-file, e.g.:
.neutrinorc.js
let revision = require('@constgen/neutrino-revision')
module.exports = {
use: [
revision()
]
}