gulp-rev

Gulp自动添加版本号

本小妞迷上赌 提交于 2020-02-23 05:21:18
推荐使用 gulp-rev + gulp-rev-collector 是比较方便的方法,结果如下: "/css/style.css" => "/dist/css/style-1d87bebe.css" "/js/script1.js" => "/dist/script1-61e0be79.js" "cdn/image.gif" => "//cdn8.example.dot/img/image-35c3af8134.gif" 但是由于公司发布系统限制,如果用上面方法实现,每次更新都会积压过多过期无用的文件,我们预期效果是: "/css/style.css" => "/dist/css/style.css?v=1d87bebe" "/js/script1.js" => "/dist/script1.js?v=61e0be79" "cdn/image.gif" => "//cdn8.example.dot/img/image.gif?v=35c3af8134" 怎么破?改上面两个Gulp插件是最高效的方法了。 安装Gulp npm install --save-dev gulp 分别安装gulp-rev、gulp-rev-collerctor npm install --save-dev gulp-rev npm install --save-dev gulp-rev-collector

Can't get gulp-rev-replace working with gulp-useref

大兔子大兔子 提交于 2019-12-31 04:12:07
问题 Continuing my previous question - but this time is the next step: getting file revisions to work. I'm working through johnpapa's course on automation with Gulp and seem to hit another wall (that's what you get when you try to adapt a concise course to a different file structure :P ). Basically, the issue is that I do get files named with a revision, but those names do not get into the end-result test.jsp , and I can't figure out why... This is the task (the minification is omitted for brevity

gulp/minify: index.html gets cryptic extension in file name, how to take advantage?

允我心安 提交于 2019-12-11 23:35:20
问题 I am minifying an index.html file with gulp (note: took over this project, build system has been done by former dev). It all works fine, but the gulp task generates a HTML file which has a cryptic extension to it, like: index-bd2c7f58f0.html I understand this must have it's advantage, but I can't grasp what...:) Because the disadvantage now is: The node server needs the presence of an index.html file to allow the '/' route to work. Thus so far, I either have to copy the file on every build or

Can't get gulp-rev-replace working with gulp-useref

孤街醉人 提交于 2019-12-02 05:57:36
Continuing my previous question - but this time is the next step: getting file revisions to work. I'm working through johnpapa's course on automation with Gulp and seem to hit another wall (that's what you get when you try to adapt a concise course to a different file structure :P ). Basically, the issue is that I do get files named with a revision, but those names do not get into the end-result test.jsp , and I can't figure out why... This is the task (the minification is omitted for brevity, but it works fine with the file revisioning): gulp.task('build-dev', ['inject'], function () { var