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
Netlify can be configured:
- In the build settings.
- In a
netlify.toml
file in the repository root directory or site base directory.
This library loads, validates, and normalizes the Netlify configuration.
Install
npm install @netlify/config
Usage (CLI)
$ netlify-config
{
"configPath": "/home/me/cv-website/netlify.toml",
"buildDir": "/home/me/cv-website",
"config": {
"build": {
"command": "gulp build",
"functions": "/home/me/cv-website/functions",
"publish": "/home/me/cv-website/build",
"environment": {
"NODE_VERSION": "12",
"AWS_LAMBDA_JS_RUNTIME": "nodejs10.x"
}
},
"plugins": []
},
"context": "production",
"branch": "master",
"siteInfo": {}
}
Usage (Node.js)
const getNetlifyConfig = require('@netlify/config')
const { configPath, buildDir, config, context, branch, siteInfo } = await getNetlifyConfig()