Buildpacks allow for various configuration options (through BP_NODE_*
variables in project.toml
or via the environment), we try to auto-detect what’s best so here is a summary.
We auto-configure when we find a npm run start
in your package.json
file. Otherwise, the assumption is that NodeJS is part of another language (e.g. Ruby, PHP, …) and used for the asset pipeline or similar. If you intend to run a NodeJS service, you will need to add something like this to your package.json
:
|
|
BP_NODE_RUN_SCRIPTS
will be set if we find a npm run build
task in your package.json
.
BP_KEEP_FILES
is set to dist/*:build/*
to match the default of most JavaScript frameworks.
When you set your own values, these values are always respected and we will stop adding them.