Last active
August 31, 2017 00:11
-
-
Save f1yn/a1e7f043a9c8ac41c86be89c522f1a37 to your computer and use it in GitHub Desktop.
Proper clean function for gulp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var del = require('del'); | |
| var gulp = require('gulp'); | |
| var buildDirectory = './path/to/something'; | |
| // the offical way to delete files (from del docs) | |
| gulp.task('clean', ()=>{ | |
| return del.sync(buildDirectory); | |
| }); | |
| // the callback method (promises) | |
| gulp.task('clean:async', (callback)=>{ | |
| del(buildDirectory).then(() => { callback() } ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment