1.0.1 • Published 8 years ago
gulp-hash-template v1.0.1
shell
$ npm install gulp-hash-template --save-dev
js
var hash = require('gulp-hash-template');
var gulp = require('gulp');
gulp.task('hash',function(){
return gulp.src(['index.html'])
.pipe(hash(
rename:true,// 将md5值追加到文件名,文件名只能使用下划线来连接
data:{ //模板数据 `<% message %>`
message:'hello template engine'
......
obj:{
msg:'' // `<%obj.msg%>`
}
key:value
}
)).pipe(...)
});
html
<script src="../hello.js" ></script>
output:
<script src="../hello.16 bit md5.js"></script>