-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Following one of your examples. I want to wrap the contents of a file in some additional lines:
gulp.task('build', function () {
return gulp.src(['./lib/**'])
.pipe(tap(function(file) {
file.contents = Buffer.concat([
new Buffer('modules.define("' + file.path + '", function(module, require) {\n'),
file.contents,
new Buffer("\n});\n")
]);
}))
.pipe(concat('index.js'))
.pipe(header(preamble))
.pipe(footer(closing))
.pipe(babel())
.pipe(gulp.dest('dist'));
});
Running gulp produces:
D:\repos\project>gulp
[09:09:59] Using gulpfile D:\repos\project\gulpfile.js
[09:09:59] Starting 'build'...
buffer.js:467
length += list[i].length;
^
TypeError: Cannot read property 'length' of null
at Function.concat (buffer.js:467:25)
at D:\repos\project\gulpfile.js:61:27
at DestroyableTransform.modifyFile [as _transform] (D:\repos\project\node_modules\gulp-tap\lib\tap.js:53:11)
at DestroyableTransform.Transform._read (D:\repos\project\node_modules\gulp-tap\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (D:\repos\project\node_modules\gulp-tap\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:172:83)
at doWrite (D:\repos\project\node_modules\gulp-tap\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:428:64)
at writeOrBuffer (D:\repos\project\node_modules\gulp-tap\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:417:5)
at DestroyableTransform.Writable.write (D:\repos\project\node_modules\gulp-tap\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:334:11)
at write (D:\repos\project\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:623:24)
at flow (D:\repos\project\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:632:7)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels