-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Expected Behavior
When NODE_ENV is specified it should override development and not the other way around.
Current Behavior
Whatever is set during build environment install process it will be overridden to development
Possible Solution
Steps to Reproduce
- Pull samples/web-servers/react-frontend-sample
- pack build --clear-cache paketo-demo-app --builder paketobuildpacks/builder-jammy-base
- Logs for buildpack for NPM install 1.4.0 show following:
Configuring build environment NODE_ENV -> "development" PATH -> "$PATH:/layers/paketo-buildpacks_npm-install/build-modules/node_modules/.bin"
Motivations
First of all I am a devops so this isn't really my cup of tea. So this is an issue my team has run into while using vite where the front builds and its throwing them errors. Whatever we do in nginx.toml it still uses the NODE_ENV=development. In the buildpack source code I found an override that always overwrites the variable you set with development I could be wrong but don't have many ideas left. I've tried locally to append env variable to 'pack build ' using --env but it does nothing.
This is the line of code I am suspecting is the issue. layer.BuildEnv.Override("NODE_ENV", "development") located here
Line 159 in 7b388f0
| layer.BuildEnv.Override("NODE_ENV", "development") |