Add a netlify.toml file to set environment variables for the build.
It is also possible to set some of those environment variables in the Netlify web app, but it would be better to manage them as code with source control. Therefore, option (1) is better than this option.
Currently, there is no configuration, so the Netlify builds are using their default settings.
Values to consider
NODE_ENV as production or development.
Netlify uses development by default.
production means do not load any of the devDependencies from package.json.
NODE_VERSION as a specific version like 14.18.0 or 14 to get the latest version of 14.x.
It would be nice if we could use the COMMIT_REF at runtime, so that when someone reports an error, we can know exactly which version was running at the time.
See Netlify's documentation:
Possible solutions
netlify.toml
file to set environment variables for the build.Values to consider
NODE_ENV
asproduction
ordevelopment
.development
by default.production
means do not load any of thedevDependencies
frompackage.json
.NODE_VERSION
as a specific version like14.18.0
or14
to get the latest version of 14.x.NPM_VERSION
Metadata
COMMIT_REF
at runtime, so that when someone reports an error, we can know exactly which version was running at the time.