JSPM

@netlify/config

0.11.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 239271
  • Score
    100M100P100Q212226F
  • License MIT

Netlify config module

Package Exports

  • @netlify/config

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@netlify/config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Netlify Config

Library for reading netlify configuration files.

About

@netlify/config brings a wide variety of new functionality to Netlify's config ecosystem.

Including:

  • Multiple config formats
  • environment variable support
  • (Future) secret support

Environment Variable Support

To reference env variables in your config file. Use the ${} bracket notation.

${env:MY_VARIABLE_KEY_NAME}

Example

thing: ${env:MY_VAR} # <-- resolves to the environment variable MY_VAR value

Example with default value

thing: ${env:OTHER_VAR, 'my-default-value'}
#      👆 If OTHER_VAR not found, this resolves my-default-value

Formats

Currently yml, toml, and json are supported by @netlify/config

Format Examples

netlify.toml!

[build]
  publish = "dist"
  command = "npm run build"
  functions = "functions"

netlify.yml!

build:
  publish: dist
  command: npm run build
  functions: functions

netlify.json!

{
  "build": {
    "publish": "dist",
    "command": "npm run build",
    "functions": "functions"
  }
}