Build: Document how to use environment variables in Build plugins

Created on 2 Apr 2020  路  3Comments  路  Source: netlify/build

We should document (in README) how to use environment variables in Build plugins.

The answer is: with process.env like any regular Node.js code.

A user today was wondering whether he should use netlifyConfig.build.environment instead.

We might want to be even more generic, saying that the environment should be as similar as possible to a regular Node.js environment, which includes filesystem, etc.

@verythorough @klavavej

documentation feature

All 3 comments

We can also handle this one if the docs team is more focused on docs.netlify.com content. Not certain if that's the case, I'll let them respond on that.

If you'd like to make a pass adding this information to the current README, that'd be great. I can revise as needed when we're ready to move the plugin-building docs into docs.netlify.com.

Sounds good! Done at #1104.

Was this page helpful?
0 / 5 - 0 ratings