Skip to content

Commit 083f3c1

Browse files
authored
feat: guidelines for proper netlifyConfig usage (#433)
1 parent b57119f commit 083f3c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/plugin_review.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ This is a non-exhaustive list of common pitfalls
8080
- [ ] The [right constants](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#constants) must be used and be correctly spelled.
8181
- [ ] `constants.CONFIG_PATH`, `constants.FUNCTIONS_SRC` and `constants.EDGE_HANDLERS_SRC` can be `undefined` when not used by the site.
8282
- [ ] `constants.PUBLISH_DIR` and `constants.FUNCTIONS_DIST` are always defined, but their target might not exist yet. If used, they should be created by the plugin they do not exist.
83-
- [ ] [`netlifyConfig`](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#netlifyconfig) should be used instead of manually loading the configuration file.
83+
- [ ] [`netlifyConfig`](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#netlifyconfig) should be used instead of manually loading the configuration file. This includes `redirects`, `headers` and `edge_handlers`.
84+
- [ ] [`netlifyConfig.build.environment`](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#netlifyconfig) should be used to modify environment variables, not `process.env`.
85+
- [ ] When modifying [`netlifyConfig`](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#netlifyconfig), plugin authors should consider appending properties instead of overriding them. For example, redirects should be pushed to `netlifyConfig.redirects` instead of overriding that property.
8486
- [ ] [`packageJson`](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#packagejson) should be used instead of manually loading the site's `package.json`.
8587

8688
## Error handling

0 commit comments

Comments
 (0)