Skip to content

Commit d232754

Browse files
authoredApr 5, 2018
Merge pull request #357 from Kamil93/patch-1
Add transform 'file' event to readme
2 parents 11989b2 + d924e9b commit d232754

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎readme.markdown

+21
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,27 @@ 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 the bundle in a non-standard way without requiring.
202+
You can inform Watchify about these files by emiting a 'file' event.
203+
204+
```
205+
module.exports = function(file) {
206+
return through(
207+
function(buf, enc, next) {
208+
/*
209+
manipulating file content
210+
*/
211+
212+
this.emit("file", absolutePathToFileThatHasToBeWatched);
213+
214+
next();
215+
}
216+
);
217+
};
218+
```
219+
199220
# install
200221

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

0 commit comments

Comments
 (0)
Please sign in to comment.