Skip to content
New issue

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

Option to override original files #149

Open
Francisc opened this issue Jan 28, 2016 · 7 comments
Open

Option to override original files #149

Francisc opened this issue Jan 28, 2016 · 7 comments

Comments

@Francisc
Copy link

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.

@zckrs
Copy link

zckrs commented Mar 2, 2016

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

@bobthecow
Copy link
Contributor

Check out gulp-rev-delete-original.

@Francisc
Copy link
Author

Francisc commented Mar 2, 2016

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.

@bobthecow
Copy link
Contributor

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 :)

@Francisc
Copy link
Author

Francisc commented Mar 2, 2016

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.

@zhouzi
Copy link
Contributor

zhouzi commented May 1, 2017

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 revised into styles-123.css. You make some changes and the css file is revised 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.

@ZhangShuaiGe
Copy link

gulp-rev 是如何知道我修改了哪些文件的?原理是什么?看完源码,没看懂。。。 每一次构建 gulp-rev是如何知道 我上一次构建状态的,我构建的时候,已经加入了很多代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants