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 of NODE_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:

RequestResponse
PASSWORD=b

# becomes 'adminb'
EXPANDED=admin$PASSWORD

# becomes 'admin$PASSWORD'
ESCAPED=admin\$PASSWORD

Do you have some feedback for us?

If you have suggestions for improving this article,