Last active
July 31, 2021 07:08
-
-
Save omniphx/e6279a2b21f8c6e2e26a to your computer and use it in GitHub Desktop.
Create a new file with gulp
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 | |
gulp = require('gulp'), | |
tap = require('gulp-tap'), | |
path = require('path'), | |
newfile = require('gulp-file'); | |
gulp.task('new-file', function(){ | |
gulp.src('./foo.derp') | |
.pipe(tap(function(file){ | |
var fileName = path.basename(file.path) + ".derp"; | |
var contents = 'hello!'; | |
return newfile(fileName, contents) | |
.pipe(gulp.dest('dist')); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment