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

Plugin not doing anything #21

Open
TheDutchCoder opened this issue Oct 1, 2019 · 2 comments
Open

Plugin not doing anything #21

TheDutchCoder opened this issue Oct 1, 2019 · 2 comments

Comments

@TheDutchCoder
Copy link

So this issue seems to have been poking its head in the repo, but I still can't this plugin to actually remove files.

My setup is:

src
  img
    file1.jpg
    file2.jpg

dest
  img
    file1.hash.jpg
    file2.hash.jpg

Gulp

const imageAssets = () => {
  return gulp.src(src)
    .pipe(rev())
    .pipe(format(hashFormat))
    .pipe(rev.manifest({ base: dest, path: dest + manifestName, merge: false }))
    .pipe(del({ oldManifest: dest + manifestName, dest: dest }))
    .pipe(gulp.dest(dest))
}

Now, whenever I remove a file from the src, it simply doesn't remove it from the dest, even though everything is configured correctly.

The manifest updates fine, the old file is no longer in there, but this plugin just won't remove the file.

@FlxSaenger
Copy link

I get your problem, but I'm not sure whether it's in the scope of this module.

The manifest updates fine, the old file is no longer in there

So how should rev-del know about that "old file" when it's no longer in the manifest (which it depends upon)? The usual approach would be to empty the whole dest/[dist]-folder before running your build task so that all assets can be copied again into dest/.

@alexandre-abrioux
Copy link

@TheDutchCoder Sorry for answering an old thread, but in case someone else needs this use-case, you can try gulp-rev-dist-clean. This is why I created this plugin originally. It is very convenient if you want to optimize your watch mode for instance, to prevent cleaning and rebuilding everything on each file change.

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

No branches or pull requests

3 participants