agarzola / gulp-deleted Goto Github PK
View Code? Open in Web Editor NEWCompare destination path with gulp.src files and remove missing.
License: MIT License
Compare destination path with gulp.src files and remove missing.
License: MIT License
All other plugins work properly without the leading slash and some require no leading slash. The current operation is very dangerous; if the leading slash is missing the plugin deletes all files in the output folder matching the second parameter.
I've been working my brain on this: problem is that the task only fires once.
So I have an app folder (= the source folder) with an assets > img folder inside. I have also a _tmp folder (destination folder) with also an assets > img folder inside.
Now what I want is, when deleting images in the app > assets > img folder, it also needs to delete it inside the _tmp > assets > img folder.
It works when deleting a first image, but when deleting a second, third,... image it doesn't delete it in the _tmp > assets > img folder, strange!!
My code:
var deleted = require('gulp-deleted' );
function deleteMatchingFiles() {
const src = 'app/assets/img/';
const dest = '_tmp/assets/img/';
gulp.src(src)
.pipe(deleted({
src,
dest,
patterns: [
'*.{png,jpg,jpeg,gif,svg}',
//'*.jpg',
//'!app/includes/',
//'!index.html',
],
})
)
.pipe(gulp.dest('_tmp/assets/img/'));
}
I also use watch:
gulp.watch('app/assets/img/*.{png,jpg,jpeg,gif,svg}', deleteMatchingFiles);
Apparently it start the 'deleteMatchingFiles' task, but it doesn't finish it...
Can someone help me?
Kind regards
Stubbled across your package on NPM and so far it's providing useful for keeping my dist and src directories in sync. One limitation that I've noticed is for files that are renamed (e.g. .scss
files that are renamed to .css
in the dist directory).
Would you accept a PR to add support for aliasing in the diff comparison?
Testing GH Issues
Is this plugin deprecated?
I saw a fork gulp-deleted2
on NPM. Why there are two versions?
https://github.com/joachimprinzbach/gulp-deleted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.