Last active
August 29, 2015 14:03
-
-
Save shinnn/ee8b4cebe470f9357910 to your computer and use it in GitHub Desktop.
ファイル削除にはgulpプラグインを使わない ref: http://qiita.com/shinnn/items/bd7ad79526eff37cebd0
This file contains 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 rimraf = require('rimraf'); | |
gulp.task('clean', function (cb) { | |
rimraf('./dir', cb); | |
}); | |
gulp.task('build', ['clean'], function() { | |
// Something | |
}); |
This file contains 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
// !!! DEPRECATED WAY !!! | |
gulp.task('clean', function() { | |
return gulp.src('./dir', {read: false}) | |
.pipe(rimraf()); | |
}); |
This file contains 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'); | |
gulp.task('clean', function(cb) { | |
del(['dist', 'tmp', '**/*.log'], cb); | |
}); | |
gulp.task('build', ['clean'], function() { | |
// Something | |
}); |
This file contains 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
gulp.task('clean', del.bind(null, ['.tmp', 'dist'])); |
This file contains 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
// !!! 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