How to use the nerdbank-gitversioning.getVersion function in nerdbank-gitversioning

To help you get started, we’ve selected a few nerdbank-gitversioning examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MartinSGill / SubnauticaWatcher / subnautica-map / webpack.config.ts View on Github external
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import * as webpack from "webpack";
import * as path from "path";
import { CheckerPlugin } from "awesome-typescript-loader";
import { AutoWebPlugin, WebPlugin } from "web-webpack-plugin";
import * as CopyWebpackPlugin from "copy-webpack-plugin";
import * as fs from 'fs';

declare var __dirname;

var nbgv = require('nerdbank-gitversioning')
nbgv.getVersion()
  .then(r => {
      var mkdirp = require('mkdirp');
      mkdirp.sync('dist/data');
      fs.writeFileSync('dist/data/version-info.json', JSON.stringify(r, null, 2), "utf8")
  })
  .catch(e => console.error(e));

const config: webpack.Configuration = {
  entry: {
    main: path.resolve(__dirname, 'src/map.ts')
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name]-subnautica-map.bundle.js'
  },

nerdbank-gitversioning

Stamps your NPM packages with semver 2.0 compliant git commit specific version information.

MIT
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis