tasks/dev/watch.js
function onEvent (watcher) {
    // Wait for write stream to end if write has been delayed.
    if (writeDelayed) { return undefined; }

    // If any watch events occur while writing to dest then restart
    // write stream with new changes.
    if (stream.isWriting()) {
        writeDelayed = true;

        stream.endWriteStream();
    // Initial write of files to dest.
    } else {
        writeStartTime = Date.now();

        writeFiles();
    }
}
function onEvent (watcher) {
    // Wait for write stream to end if write has been delayed.
    if (writeDelayed) { return undefined; }

    // If any watch events occur while writing to dest then restart
    // write stream with new changes.
    if (stream.isWriting()) {
        writeDelayed = true;

        stream.endWriteStream();
    // Initial write of files to dest.
    } else {
        writeStartTime = Date.now();

        writeFiles();
    }
}
function onEvent ( watcher ) { // Wait for write stream to end if write has been delayed. if ( writeDelayed ) { return undefined ; } // If any watch events occur while writing to dest then restart // write stream with new changes. if ( stream . isWriting ( ) ) { writeDelayed = true ; stream . endWriteStream ( ) ; // Initial write of files to dest. } else { writeStartTime = Date . now ( ) ; writeFiles ( ) ; } }
Write files whenever a watch event happens.

@function onEvent
@param {Watcher} watcher
@api private
Write files whenever a watch event happens .