Previously we would set NODE_ENV=baps-<env> to signal that this is a BAPS build. However, many libraries rely on NODE_ENV=="production" to activate optimisations, meaning performance tanked.
This commit reorganises it to avoid relying on NODE_ENV changes, while still applying env vars as necessary.