bin/appcache-manifest.js
function watch(globs, options) {
    options.delay = 1000

    chokidar
        .watch(globs, { persistent: true, ignoreInitial: true })
        .on("add", () => generate(globs, options))
        .on("unlink", () => generate(globs, options))
        .on("change", () => generate(globs, options))
        .on("error", (err) => console.error(`ERROR: ${err.message}`))
        .on("ready", () => {
            if (options.verbose) {
                console.log(`Be watching ${globs.join(", ")}`)
            }
        })

    // In order to kill by the test harness.
    process.on("message", () => {
        process.exit(0)
    })
}
function watch(globs, options) {
    options.delay = 1000

    chokidar
        .watch(globs, { persistent: true, ignoreInitial: true })
        .on("add", () => generate(globs, options))
        .on("unlink", () => generate(globs, options))
        .on("change", () => generate(globs, options))
        .on("error", (err) => console.error(`ERROR: ${err.message}`))
        .on("ready", () => {
            if (options.verbose) {
                console.log(`Be watching ${globs.join(", ")}`)
            }
        })

    // In order to kill by the test harness.
    process.on("message", () => {
        process.exit(0)
    })
}
function watch ( globs , options ) { options . delay = 1000 chokidar . watch ( globs , { persistent : true , ignoreInitial : true } ) . on ( "add" , ( ) => generate ( globs , options ) ) . on ( "unlink" , ( ) => generate ( globs , options ) ) . on ( "change" , ( ) => generate ( globs , options ) ) . on ( "error" , ( err ) => console . error ( ` ${ err . message } ` ) ) . on ( "ready" , ( ) => { if ( options . verbose ) { console . log ( ` ${ globs . join ( ", " ) } ` ) } } ) // In order to kill by the test harness. process . on ( "message" , ( ) => { process . exit ( 0 ) } ) }
Generate appcache manifest for each change.

@param {string[]} globs - The globs which specifies the target files.
@param {object} options - The option object.
@returns {void}
@private
Generate appcache manifest for each change .