1.0.4 • Published 8 years ago

gulp-md5-version v1.0.4

Weekly downloads
49
License
ISC
Repository
github
Last release
8 years ago

gulp-md5-version

md5 plugin for gulp ,md5 the static files and then create a versonMapping file.

Usage

First, install gulp-md5-version as a development dependency:

npm install --save-dev gulp-md5-version

Then, add it to your gulpfile.js:

var md5 = require("gulp-md5-version");

gulp.src("./src/*.css")
	.pipe(md5())
	.pipe(gulp.dest("./prd"));

will create a versions.mapping

API

md5(config)

config.hashLength

Type: String
Default: 32

Optionnal: you can pass the size to limit the size of the hash that is appended.

config.pattern

Type: String
Default: @

Optionnal: Hash connector

config.versionName

Type: String
Default: versions.mapping

Optionnal: version file name

config.versionPath

Type: String
Default: prd/

Optionnal: version root path

Example:

	gulp.src('src/**/*.js')
        .pipe(md5({
            hashLength: 16,
            versionName: '.ver'
        })
        .pipe(gulp.dest('./prd'));

The sample above will append the md5 hash to each of the file in the src/ folder then create a .ver file in the /prd with all versionMapping;

License

http://en.wikipedia.org/wiki/MIT_License[MIT License]

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago