Function serialHooks

  • By default, the functions are called in parallel (via Promise.all). If you need the functions called serially, you can use the serialHooks utility function:

    const { packager, serialHooks } = require('@electron/packager')

    packager({
    // ...
    afterCopy: [serialHooks([
    (buildPath, electronVersion, platform, arch, callback) => {
    setTimeout(() => {
    console.log('first function')
    callback()
    }, 1000)
    },
    (buildPath, electronVersion, platform, arch, callback) => {
    console.log('second function')
    callback()
    }
    ])],
    // ...
    })

    Parameters

    Returns ((...serialHookParams) => Promise<void>)