Env file support
Current version: 19.x
The JSS CLI supports loading environment variables from .env
files that can be used to populate environment variables.
Variables are loaded from .env
files with the following priority:
-
.env.${NODE_ENV}.local
. -
.env.local
, unless the value ofNODE_ENV
is "test". -
.env.${NODE_ENV}
. -
.env
.
The CLI automatically expands variables inside of your .env*
files. This allows you to reference other values. If you are attempting to use a $
in a variable value, it needs to be escaped with a backslash \
. For example:
RequestResponseshell
PASSWORD=b
# becomes 'adminb'
EXPANDED=admin$PASSWORD
# becomes 'admin$PASSWORD'
ESCAPED=admin\$PASSWORD