Closed leonderijke closed 6 years ago
Hey @leonderijke I was just looking into this and this looks good to me! :+1:
I was thinking this might have to do with legacy APP_ENV
support, but I was mistaken since we in the end decided to remove APP_ENV
completely in favor of the more common NODE_ENV
.
However I'm a little confused by your last remark that this is a partial solution to #187. Partial in what way?
Parameters aren't passed through when maji build
is called from maji run
. This PR only changes that NODE_ENV
is read by maji build
.
So, these two commands should have the same output, but they don't:
bin/maji run --env test
: will build production
NODE_ENV=test bin/maji run
: will build test
A complete solution to #187 will have both commands produce the same output (test
environment).
@leonderijke I would like to merge this as is, even if it's not a complete solution. I wan't to get rid of all bash scripts soon anyway, so there's not much point in fixing this now.
No problem! :shipit:
The
bin/maji build
command wasn't able to readNODE_ENV
from the environment, only from the passed in options. Because the build command is called from thebin/maji run
command, but without passing in options, we should read from the environment.If you set the environment of the run command by using the options:
bin/maji run --env test
, it will still build production. If you set it via theNODE_ENV
environment variable it will build the right environment:NODE_ENV=test bin/maji run
.Therefore, this is a partial solution to #187.