Closed JBallin closed 6 years ago
create-react-app's build command, react-scripts build
(called by the inner buildpack's compile script) always generates a production build, regardless of what the env variables are set too.
NODE_ENV
& NPM_CONFIG_PRODUCTION
are set to install the devDependencies so that the tooling is available when the production build is performed.
This buildpack only uses Node to build the javascript bundle. The runtime is an Nginx web server. NODE_ENV
does absolutely nothing in the runtime.
This is explained in more detail in the architecture of this buildpack.
@mars thanks for the response!
NODE_ENV
isn't mentioned anywhereNODE_ENV
and find something.NODE_ENV
is now documented in README Architecture 🏙
I've noticed other posters' build logs had their
NODE_ENV
being set to production (After "Creating runtime environment"). Why is mine not? I've set up an app completely from scratch following the directions on the repo.Also I would love a note in the README explaining why NODE_ENV is being set to development. I believe it's required for the build because our project dependencies become devDependencies for the build?