has been using grunt, the total sense of Grunt parameter configuration method is very cumbersome, not a clearer flow, coupled with their own gulp flow operations more interested in the decision to go to gulp.
Believe that the front-end ER in the release of their own code, if not using some of the front-end building tools, for frequent online projects, their own manual compression and packaging to replace the CDN prefix that is a terrible thing. So using the Gulp front-end build tool is a very sensible choice.
First of all, what do you need to do when you publish your project:
1. Compression consolidation for static resources
2. Js,css,img and other resources to add MD5 stamp
3. References in the replacement file for an HTML file that references the above MD5 stamp.
4. Add CDN prefix for references in HTML file
Although it looks like these 4 steps, but the task is still difficult to write.
Code on:
[JavaScript] View Plain copy Var gulp = require (' Gulp '); Var minimist = require (' minimist '); var uglify = require (' gulp-uglify '); var minifyhtml = require (' Gulp-minify-html '); var minifycss = require (' Gulp-minify-css '); var rev = require (' Gulp-rev '); var revreplace = require (' gulp-rev-replace '); var prefix = require (' Gulp-prefix '); var zip = require (' Gulp-zip '); var gulpsequence = require (' gulp-sequence '); var cmd = { string:&nbSP; ' V ', default: { v: ' 1.0 ' } }; var option = { src: ' poster ', dest: ' Poster/build ', cdn: ' Http://sns_wf.cdn.sohusce.com '///poster/ } var options = minimist (Process.argv.slice (2), cmd); var version = options.v; //after unification plus MD5 replace references gulp.task (' CDN ', Function () { var revall = new revall ({dontrenamefile:[/^\/.*.html/]});// ,/^\/.*.jpg|png/  GULP.SRC ([option.src+ '/templates-dev/*.html ', option.src+ '/static/** ']) .pIpe (Revall.revision ()) .pipe (gulp.dest (option.dest+ '/' +version)) .pipe (Revall.versionfile ()) .pipe (Gulp.dest ( option.dest+ '/' +version) .pipe (Revall.manifestfile ()) .pipe (Gulp.dest (option.dest+ '/' +version)); }); gulp.task ("Rep" ,function () { var  MANIFEST = GULP.SRC (option.dest + '/' + version + "/rev-manifest.json") ); console.log (option.dest + '/' + version);    RETURN GULP.SRC (option.dest + '/' + version + '/templates-dev/*.html ') ) .pipe (Revreplace ({manifest: manifest})) .pipe (GULP.DEST (option.src + '/templates ' )); }); &