├── README.md ├── gulp-asset-rev ├── .gitignore ├── README.md ├── dest │ ├── styles │ │ └── test.css │ └── test.html ├── gulpfile.js ├── index.js ├── package.json └── test │ ├── images │ ├── bg.png │ └── test.png │ ├── scripts │ └── test.js │ ├── styles │ └── test.css │ └── test.html ├── gulp-content-includer ├── .gitignore ├── README.md ├── content.html ├── footer.html ├── gulpfile.js ├── header.html ├── inc │ ├── meta.html │ └── subinc │ │ └── meta.html ├── index.html ├── index.js └── package.json ├── gulp-make-css-url-version ├── README.md ├── index.js └── package.json ├── gulp-minify-inline-scripts ├── README.md ├── index.js └── package.json ├── gulp-require-tpl2js ├── .gitignore ├── README.md ├── gulpfile.js ├── index.js ├── package.json ├── test.bak.tpl └── test.tpl ├── gulp-rev-files ├── .gitignore ├── README.md ├── dest │ ├── images │ │ ├── bg-2769acd3.png │ │ └── test-25cf2b4e.png │ ├── scripts │ │ └── test-8ced4e61.js │ ├── styles │ │ └── test-dd42597b.css │ └── test-375782d0.html ├── gulpfile.js ├── index.js ├── package.json └── test │ ├── images │ ├── bg.png │ └── test.png │ ├── scripts │ └── test.js │ ├── styles │ └── test.css │ └── test.html └── gulp-utf8-convert ├── .gitignore ├── README.md ├── gulpfile.js ├── index.js ├── package.json └── test.txt /README.md: -------------------------------------------------------------------------------- 1 | gulp_plugin 2 | =========== 3 | 4 | plugins for gulp.js 5 | 6 | ###gulp-minify-inline-scripts 7 | 8 | minify inline scripts in html file 9 | 10 | ###gulp-make-css-url-version 11 | 12 | replace version for images in css files 13 | 14 | ###gulp-utf8-convert 15 | 16 | convert file encoding to utf8 17 | 18 | ###gulp-require-tpl2js 19 | 20 | convert tpl files content to js for requirejs 21 | 22 | ###gulp-content-includer 23 | 24 | include files 25 | 26 | ###gulp-asset-rev 27 | 28 | replace asset's filename by adding file hash 29 | -------------------------------------------------------------------------------- /gulp-asset-rev/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /gulp-asset-rev/README.md: -------------------------------------------------------------------------------- 1 | ## gulp-asset-rev 2 | 3 | a plugin for gulp.js to replace file's name by adding content hash 4 | 5 | ## Installation 6 | 7 | ```bash 8 | npm install gulp-asset-rev 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```js 14 | var gulp = require('gulp'); 15 | var assetRev = require('gulp-asset-rev'); 16 | 17 | gulp.task('rev',function() { 18 | gulp.src("./test/test.html") 19 | .pipe(assetRev()) 20 | .pipe(gulp.dest('./')); 21 | }); 22 | ``` 23 | 24 | ## Options 25 | 26 | ### hashLen: length of hash version string 27 | Type: `Number` default: 7 28 | 29 | ### verConnecter: version connect char 30 | Type: `String` default: '-' 31 | 32 | ### rootPath: it should be assigned when the asset's path is an absolute path 33 | Type: `String` default: "" 34 | 35 | ### verStr: use custom version string 36 | Type: `String` 37 | 38 | ## Example 39 | 40 | ```js 41 | var gulp = require('gulp'); 42 | var assetRev = require('./index.js'); 43 | 44 | gulp.task('rev',['revCss'],function() { 45 | gulp.src("./test/test.html") 46 | .pipe(assetRev()) 47 | .pipe(gulp.dest('./dest')); 48 | }); 49 | 50 | gulp.task('revCss',function () { 51 | return gulp.src('./test/styles/test.css') 52 | .pipe(assetRev()) 53 | .pipe(gulp.dest('./dest/styles/')) 54 | }); 55 | gulp.task('default',['rev']); 56 | ``` 57 | 58 | ### before: test.css 59 | ```css 60 | body{background:url('../images/bg.png')} 61 | ``` 62 | 63 | ### after: test.css 64 | ```css 65 | body{background:url("../images/bg_2769acd.png"} 66 | ``` 67 | ### before: test.html 68 | ```html 69 | 70 |
71 | 72 |
78 |
95 |
11 |