How to use the @netlify/config.LIFECYCLE.flatMap function in @netlify/config

To help you get started, we’ve selected a few @netlify/config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netlify / build / packages / build / src / core / instructions.js View on Github external
const getInstructions = function({ pluginsHooks, config }) {
  const instructions = LIFECYCLE.flatMap(hook => getHookInstructions({ hook, pluginsHooks, config }))

  const buildInstructions = instructions.filter(
    instruction => !isEndInstruction(instruction) && !isErrorInstruction(instruction),
  )
  const endInstructions = instructions.filter(isEndInstruction)
  const errorInstructions = instructions.filter(isErrorInstruction)

  const mainInstructions = [...buildInstructions, ...endInstructions]
  const instructionsCount = mainInstructions.length
  return { mainInstructions, buildInstructions, endInstructions, errorInstructions, instructionsCount }
}