Coder Social home page Coder Social logo

gulp's Introduction

1.npm install

① 在node_modules 目录下 找到gulp-rev 目录 在该目录下 找到index.js 134行的 manifest[originalFile] = revisionedFile; 替换成 manifest[originalFile] = originalFile+'?v='+ file.revHash; ② 在 gulp-rev 目录下的 在node_modules目录下 找到 rev-path目录 在该目录下的index.js文件中 10行的 全部替换成 return modifyFilename(pth, function (filename, ext) { // return filename + '-' + hash + ext; return filename + ext; }); ③在在node_modules目录下 找到 gulp-rev-collector 目录 在该目录下 找到index.js 将40-47行 // let cleanReplacement = path.basename(json[key]).replace(new RegExp( opts.revSuffix ), '' ); // if (!~[ // path.basename(key), // _mapExtnames(path.basename(key), opts) // ].indexOf(cleanReplacement) // ) { // isRev = 0; // } 注释掉 替换成 if ( path.basename(json[key]).split('?')[0] !== path.basename(key) ) { isRev=0; } 然后在141行 regexp: new RegExp( dirRule.dirRX + pattern, 'g' ) 替换成 regexp: new RegExp( dirRule.dirRX + pattern+'(\?v=\w{10})?', 'g' ),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.