gulp-rev-replace-stream
A plugin for Gulp
Last updated 6 years ago by lynndylanhurley .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-rev-replace-stream 
SYNC missed versions from official npm registry.

gulp-rev-replace-stream

[![NPM version][https://badge.fury.io/js/gulp-rev-replace-stream.png][https://npmjs.org/package/gulp-rev-replace-stream]

rev-replace-stream plugin for gulp

Usage

First, install gulp-rev-replace-stream as a development dependency:

npm install --save-dev gulp-rev-replace-stream

Then, add it to your gulpfile.js:

$ = require('gulp-load-plugins')()

// optimize
gulp.task 'optimize', function() {

  jsFilter     = $.filter('src/**/*.js');
  cssFilter    = $.filter('src/**/*.css');
  userefFilter = $.useref.assets();

  gulp.src('src/index.html', {base: 'src'})
    .pipe(userefFilter)
    .pipe(jsFilter)
    .pipe($.uglify())
    .pipe(jsFilter.restore())
    .pipe(cssFilter)
    .pipe($.minifyCss())
    .pipe(cssFilter.restore())
    .pipe(userefFilter.restore())
    .pipe($.useref())
    .pipe($.buffer())
    .pipe($.if(/^((?!(index\.html)).)*$/, $.rev()))
    .pipe($.revReplaceStream())
    .pipe(gulp.dest('dist'))
    .pipe($.size())
}

API

revReplaceStream()

TODO: add instrutions.

License

MIT License

Current Tags

  • 0.0.1-alpha4                                ...           latest (6 years ago)

4 Versions

  • 0.0.1-alpha4                                ...           6 years ago
  • 0.0.1-alpha3                                ...           6 years ago
  • 0.0.1-alpha2                                ...           6 years ago
  • 0.0.1-alpha1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |