Skip to content

Instantly share code, notes, and snippets.

@shinnn
Last active August 29, 2015 14:03
Show Gist options
  • Save shinnn/ee8b4cebe470f9357910 to your computer and use it in GitHub Desktop.
Save shinnn/ee8b4cebe470f9357910 to your computer and use it in GitHub Desktop.
ファイル削除にはgulpプラグインを使わない ref: http://qiita.com/shinnn/items/bd7ad79526eff37cebd0
var rimraf = require('rimraf');
gulp.task('clean', function (cb) {
rimraf('./dir', cb);
});
gulp.task('build', ['clean'], function() {
// Something
});
// !!! DEPRECATED WAY !!!
gulp.task('clean', function() {
return gulp.src('./dir', {read: false})
.pipe(rimraf());
});
var del = require('del');
gulp.task('clean', function(cb) {
del(['dist', 'tmp', '**/*.log'], cb);
});
gulp.task('build', ['clean'], function() {
// Something
});
gulp.task('clean', del.bind(null, ['.tmp', 'dist']));
// !!! DEPRECATED WAY !!!
gulp.task('clean', function(cb) {
gulp.src(['dist', 'tmp', '**/*.log'], {read: false})
.pipe(rimraf());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment