From 9ea8a659b1baa44eb8ca8a16ec64b1b51939b5b3 Mon Sep 17 00:00:00 2001 From: Kamil93 Date: Wed, 4 Apr 2018 21:03:59 +0200 Subject: [PATCH] Support for working with transforms Informing Watchify about files to watch. --- readme.markdown | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/readme.markdown b/readme.markdown index 5904f84..7fc7df3 100644 --- a/readme.markdown +++ b/readme.markdown @@ -196,6 +196,25 @@ X bytes written (Y seconds) with the number of bytes in the bundle X and the time in seconds Y. +# working with browserify transforms + +If your custom transform for browserify adds new files to bundle in a non-standard way without requiring. +You can inform Watchify about these files by emiting 'file' event. + +module.exports = function(file) { + return through( + function(buf, enc, next) { + /* + manipulating file content + */ + + this.emit("file", absolutePathToFileThatHasToBeWatched); + + next(); + } + ); +}; + # install With [npm](https://npmjs.org) do: