Open Francisc opened 8 years ago
Strange feature asked. But keep in your mind one Gulp plugin = one feature
After gulp-rev you can use gulp-rename and gulp.dest to move your files
Check out gulp-rev-delete-original
.
It's more like an option than a feature.
This plugin takes style.css and creates style.ab123.css.
Why not take an {override:true}
option to replace the revisioned file?
I can't think of any use case where one would like to keep both.
I know about gulp-rev-delete-original, but it's easier to pass a flag than to add another dependency.
I can't think of any use case where one would like to keep both.
I can't think of any use case where the first should be written to disk to begin with :)
Ha, well I like to keep the rev tasks separate from the CSS, JS etc tasks so that it's like a component I can remove or replace easily.
So it would looke like:
'build-js'
, 'revision-js'
Build writes to dist, revision reads from dist and writes again.
There's also gulp.watch and livereloading that don't play well with revisioning assets because they also update HTML files and that triggers a full reload instead of a local one - like for CSS files.
That sounds like an interesting idea. Just to be sure, @Francisc you are suggesting that old files should be deleted when new ones are created?
For examples, you have a css file that is rev
ised into styles-123.css
. You make some changes and the css file is rev
ised again, into styles-456.css
.
In this situation, you would like to have an option to tell gulp-rev
to delete styles-123.css
, right?
It makes sense. We'd have to think about it and make sure it's not colliding with other aspects though.
gulp-rev 是如何知道我修改了哪些文件的?原理是什么?看完源码,没看懂。。。 每一次构建 gulp-rev是如何知道 我上一次构建状态的,我构建的时候,已经加入了很多代码
Hi,
Is there a way (or future plans) to provide an option to gulp-rev asking it to rename / replace the original files instead of preserving them and creating new ones?
Thanks.