From 1bb9e838a6bce07d1b5b333a737f3000671dd2ee Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Fri, 1 Feb 2019 17:13:22 -0800 Subject: [PATCH] Add note about comments in .env files You can put "comments" in .env files, because lines that don't start with letters or numbers are ignored - see [here](https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/util/loadEnv.js#L17) for the code that reads these files. I'm not sure if this constitutes "official" support for comments in .env files or not - or if it's just taking advantage of an implementation detail. Either way, I wanted to put comments into this file, so this was useful information to me - and something that I had to figure out myself. This commit adds a note about this to the docs, using the `#` to denote a comment line - although any non-alphanumeric char would work. --- docs/guide/mode-and-env.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/guide/mode-and-env.md b/docs/guide/mode-and-env.md index 94fcbc9404..5e557a49f0 100644 --- a/docs/guide/mode-and-env.md +++ b/docs/guide/mode-and-env.md @@ -9,10 +9,12 @@ You can specify env variables by placing the following files in your project roo .env.[mode].local # only loaded in specified mode, ignored by git ``` -An env file simply contains key=value pairs of environment variables: +An env file simply contains key=value pairs of environment variables (lines not starting with letter or numbers will be ignored): ``` +# Comment FOO=bar +#OLD_VAR=not_used VUE_APP_SECRET=secret ```