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:
Promise.all
serialHooks
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() } ])], // ...}) Copy
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() } ])], // ...})
Rest
By default, the functions are called in parallel (via
Promise.all
). If you need the functions called serially, you can use theserialHooks
utility function: