We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//将js加上10位md5,并修改html中的引用路径,该动作依赖build-js
gulp.task('md5:js', ['build-js'], function (done) { gulp.src('dist/js/*.js') .pipe(md5(10, 'dist/app/*.html')) .pipe(gulp.dest('dist/js')) .on('end', done); });
如gulp 3次,dist文件夹会出现像下面一样 news-list_fcffee5ba9.js news-list_fcffee5ba9_fcffee5ba9.js news-list_fcffee5ba9_fcffee5ba9_fcffee5ba9.js
The text was updated successfully, but these errors were encountered:
楼上,我给你提供一种解决方法: src中配置成数组,末尾元素配置成排除项,排除md5格式的文件
gulp.task('md5:js', ['build-js'], function (done) { gulp.src([ 'dist/js/*.js', '!dist/js/*_??????????.js'//排除*_md5.js ]) .pipe(md5(10, 'dist/app/*.html')) .pipe(gulp.dest('dist/js')) .on('end', done); });
备注:gulp支持的是伪正则,为什么说是“伪”,因为我尝试过写真正的正则表达式,失败了
Sorry, something went wrong.
No branches or pull requests
//将js加上10位md5,并修改html中的引用路径,该动作依赖build-js
如gulp 3次,dist文件夹会出现像下面一样
news-list_fcffee5ba9.js
news-list_fcffee5ba9_fcffee5ba9.js
news-list_fcffee5ba9_fcffee5ba9_fcffee5ba9.js
The text was updated successfully, but these errors were encountered: