drop-in replacement for gulp.dest that writes output atomically
npm install gulp-dest-atomic> drop-in replacement for gulp.dest that writes output atomically
Just replace your calls to gulp.dest with destAtomic. Each generated file
from the Vinyl stream will be written under a temporary name, then moved into
place.
destAtomic accepts all the same options as gulp.dest.
``js
var destAtomic = require('gulp-dest-atomic');
gulp.task('build', function() {
return gulp.src('some/*/glob')
.pipe(someTransform())
.pipe(destAtomic('./dest/path'));
});
`
You could also load it through gulp-load-plugins if you prefer:
`js
var $ = require('gulp-load-plugins')();
gulp.task('build', function() {
return gulp.src('some/*/glob')
.pipe(someTransform())
.pipe($.destAtomic('./dest/path'));
});
``