0.1.4 • Published 10 years ago

gulp-static-hash v0.1.4

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

gulp-static-hash

A gulp plugin for cache files by adding a hash version append their name(like a.js?v=hash).

Install

npm install --save-dev gulp-static-hash

Examples

Default

var gulp = require('gulp');
var staticHash = require('gulp-static-hash');

gulp.task('static-hash-html', function () {
	gulp.src('static/**/*.html')
		.pipe(staticHash({asset: 'static'}))
		.pipe(gulp.dest('dest'));
});

Input:

<link rel="stylesheet" href="main.min.css">
<script src="main.min.js"></script>
<img src="main.png" />

Output:

<link rel="stylesheet" href="main.min.css?v=8501b2b">
<script src="main.min.js?v=8501b2b"></script>
<img src="main.png?v=8501b2b" />

Options

asset: 'static'

The path to assets in your project

exts: 'js', 'css', 'png'

The extension list need add hash version

md5BuildAsset: 'static'

The path to assets in your project used by create md5 file

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago