2.0.0 • Published 7 years ago

gulp-task-rev v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

gulp-task-rev Circle CI npm version

Gulp task for performing static asset revisioning by appending content hash to filenames. Original paths in html/js/css files will be automatically replaced with the revisioned path. Option to add a prefix to revisioned paths (i.e. CDN host).

Usage

import gulp from 'gulp';
import rev from 'gulp-task-rev';

gulp.task('rev', rev({
  src: 'public',
  ignore: '**/favicon.{ico,png}'
}));
$ gulp rev

API

rev(options[, extendsDefaults])

Return: Function

options

Type: Object

Options that define the behavior of this task. This object is parsed by config() in gulp-task-helpers, so you can target specific NODE_ENV environments.

options.src

Type: string Default: undefined

Path to the directory that contains files that needs to be revisioned. If unspecified, this task is disabled. By default, the most common file extensions are used.

options.manifestFile

Type: string Default: rev-manifest.json

Name of the generated manifest file.

options.ignore

Type: string or Array Default: **/favicon.{ico,png}

Glob pattern(s) matching files to ignore for revisioning.

options.replace

Type: string Default: undefined

Path to the directory that contains files that might have the original file paths of the revisioned files. Only the directory path is needed. This module automatically scans for html/js/css files within the directory. Defaults to the same directory as options.src.

options.publicPath

Type: string Default: /

Public path to be prefixed to the revisioned file paths (i.e. CDN host).

extendsDefaults

Type: boolean Default: true

Maps to useConcat param in config() of gulp-task-helpers.

Disclaimer

This is an experimental project driven by internal requirements.

License

This software is released under the MIT License.

2.0.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.2

8 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago