gulp-stemp

1.0.1 • Public • Published

npm npm Dependency Status devDependency Status

gulp-stemp

install

npm install gulp-stemp -S

configurable gulp task for adding stemp variable into files

USAGE

'use strict';
 
const gulp = require('gulp');
const moment = require('moment');
const gulpStemp = require('gulp-stemp');
const pkg = require('package.json');
 
const dateStemp = moment().format('DD-MM-YYYY HH:mm');
 
gulp.task(() =>
  gulp
    .src([
      './dist/**/*.js'
    ])
    .pipe(gulpStemp({
      stemp: (filename) => `v${pkg.version}  [${dateStemp}]`,
      key: (filename) => `__${String(path.basename(filename, path.extname(filename))).toUpperCase().replace(/\W/g, '_')}_VERSION__` })
    )
    .pipe(gulp.dest('./dist'))
);

options

options.stemp

  • function for get stemp by filename Default: (filename) => Date.now(),

options.key

  • global varname Default: (filename) => 'window.__STEMP__'

Package Sidebar

Install

npm i gulp-stemp

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • alxe.master