How to use the @netlify/config.getBaseDir 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 / config.js View on Github external
const loadConfig = async function({ flags: { config, cwd }, flags: { token = NETLIFY_TOKEN, ...flags } }) {
  logFlags(flags)

  const flagsA = { ...DEFAULT_FLAGS, ...flags }

  const configPath = await getConfigPath(config, cwd)
  logConfigPath(configPath)
  const baseDir = await getBaseDir(configPath)

  try {
    const netlifyConfig = await resolveConfig(configPath, flagsA)
    return { netlifyConfig, configPath, token, baseDir }
  } catch (error) {
    error.message = `Netlify configuration error:\n${error.message}`
    throw error
  }
}