Skip to content

Commit 9ea8a65

Browse files
author
Kamil93
authoredApr 4, 2018
Support for working with transforms
Informing Watchify about files to watch.
1 parent 11989b2 commit 9ea8a65

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
 

‎readme.markdown

+19
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@ X bytes written (Y seconds)
196196

197197
with the number of bytes in the bundle X and the time in seconds Y.
198198

199+
# working with browserify transforms
200+
201+
If your custom transform for browserify adds new files to bundle in a non-standard way without requiring.
202+
You can inform Watchify about these files by emiting 'file' event.
203+
204+
module.exports = function(file) {
205+
return through(
206+
function(buf, enc, next) {
207+
/*
208+
manipulating file content
209+
*/
210+
211+
this.emit("file", absolutePathToFileThatHasToBeWatched);
212+
213+
next();
214+
}
215+
);
216+
};
217+
199218
# install
200219

201220
With [npm](https://npmjs.org) do:

0 commit comments

Comments
 (0)
Please sign in to comment.