gulp-rev-doc

0.0.5 • Public • Published

gulp-rev-doc

gulp插件,静态资源加版本号。

View

before

<link href="abc.css" rel="stylesheet">
<script type="text/javascript" src="abc.js"></script>
<img src="abc.jpg" width="176" height="106" alt="" />
body {
  background: url("abc.jpg");
}

after

<link href="abc.css?v=c689073d22c3" rel="stylesheet">
<script type="text/javascript" src="abc.js?v=be3c502107d9"></script>
<img src="abc.jpg?v=a96086485c4d" width="176" height="106" alt="" />
body {
  background: url("abc.jpg?v=a96086485c4d");
}

Usage

npm install gulp-rev-doc --save-dev
var gulp = require('gulp')
var revDoc = require('gulp-rev-doc');


gulp.task('html', function() {
    return gulp.src('./src/**/*.html')
        .pipe(revDoc())
        .pipe(gulp.dest('./src'))
});


gulp.task('css', function() {
    return gulp.src('./src/**/*.css')
        .pipe(revDoc())
        .pipe(gulp.dest('./src'))
});

gulp.task('default', ['html', 'css']);

Links

License

MIT

Dependents (0)

Package Sidebar

Install

npm i gulp-rev-doc

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • kyo4311