gulp-hash-template

1.0.1 • Public • Published

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>

Readme

Keywords

Package Sidebar

Install

npm i gulp-hash-template

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • zuimeiaj