0.0.1 • Published 4 years ago

parcel-plugin-git-build-info v0.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

parcel-plugin-git-build-info

Parcel plugin that stores build information as environment variables for use within your project, either during development or in a production build.

Install

# yarn
yarn add -D parcel-plugin-git-build-info

# or npm
npm i -D parcel-plugin-git-build-info

Usage

This plugin places build information into environment variables.

Environment VariableDescription
BUILD_DATEISO Date representing when the build was created, in the form YYYY-MM-DDTHH:mm:ss.sssZ
BUILD_VERSIONCurrent git rev of HEAD. Equivalent to running git rev-parse --short HEAD
PACKAGE_VERSIONVersion number from package.json at the time of the build

Example

console.log(
  'Build info:',
  new Date(process.env.BUILD_DATE),
  process.env.BUILD_VERSION,
  process.env.PACKAGE_VERSION,
)