Gulp some important points in the process of automatically adding version numbers

Source: Internet
Author: User

1. Opennode_modules\gulp-rev\index.js

Line 144th Manifest[originalfile] == Originalfile + '? v= ' + File.revhash;

2. Open Node_modules\gulp-rev\nodemodules\rev-path\index.js

return filename + '-' + hash +return filename + ext;

3. Opennode_modules\gulp-rev-collector\index.js

if (Path.basename (Json[key]). Replace (new RegExp (opts.revsuffix), ')!==if (Path.basename ( Json[key]). Split ('? ') [0]!== Path.basename (key)) {

4, gulp replace the link of aspx file, garbled, resolved as follows:

Open Node_modules\gulp-rev-collector\index.js, Global search Mutables.foreach (, modify its code to:

Mutables.foreach (function(file) {if(!File.isnull ()) {                varsrc = file.contents.toString (' UTF8 '); Changes.foreach (function(r) {src=src.replace (R.regexp, r.replacement);                }); //src = "EF BB BF" + src;                varContent =NewBuffer (src, "UTF8"); //Add a step to determine whether it is a document with a BOM                varBomtag = ["239", "187", "191"]; if(! (content[0].tostring). toLowerCase () = = "EF" && content[1].tostring (+). toLowerCase () = = "BB" && Content[3].tostring (+). toLowerCase () = = "BF") ) {content= Buffer.concat ([NewBuffer (Bomtag), content], Content.length + 3); } file.contents=content; }             This. push (file); },  This);

Gulp some important points in the process of automatically adding version numbers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.