process.env
object like so: process.env.YOUR_KEY_HERE
. But your user's browser won't have access to a process
object. How will we handle this?EnvironmentPlugin
to do this. It takes an array of environment variable names to allow in your application. Then all instances of process.env.YOUR_KEY_HERE
will be replaced with the value in your environment. mix.env
method that passes through to EnvironmentPlugin
.NODE_ENV
is a very common environment variable used by many libraries to output additional debugging information or to enable optimizations. Since Elixir already knows what environment you are building for, this value is defaulted for you. If you desire to override that value, just define NODE_ENV
in your environment and it will take precendence.