How to use the git-rev-sync.isTagDirty function in git-rev-sync

To help you get started, we’ve selected a few git-rev-sync 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 imyelo / pokequest-wiki / vue.config.js View on Github external
const rev = require('git-rev-sync')
const CACHEABLE_DIRECTORY = 'static'

const version = rev.isTagDirty() ? `${rev.tag()}-${rev.short('.')}` : rev.tag()

module.exports = {
  assetsDir: CACHEABLE_DIRECTORY, // cacheable dir

  chainWebpack (config) {
    let images = config.module.rule('images')

    images.uses.clear()
    images
      .use('file-loader')
        .loader('file-loader')
        .options(config.module.rule('svg').use('file-loader').get('options'))

    config.plugin('define-version')
      .use(require('webpack/lib/DefinePlugin'), [{
        'DEFINED_VERSION': JSON.stringify(version),

git-rev-sync

Synchronously get the current git commit hash, tag, or branch

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages