From 6068ab4bef0a7b81bc02077f99384dc20087fbdf Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Tue, 15 Dec 2020 01:26:06 +0100 Subject: [PATCH] Add option to specify .env filename in development When required from the command line, dotenv loads the .env file specified by the DOTENV_CONFIG_PATH env var. Files with a filename pattern of the form .env.* are ignored by git to make it easier to work with multiple different database vendors. --- .gitignore | 1 + api/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 78fe13fe78..3efdee17c2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules .vscode .env +.env.* .secrets npm-debug.log lerna-debug.log diff --git a/api/package.json b/api/package.json index 719bdb5db6..b8a2ebb7f1 100644 --- a/api/package.json +++ b/api/package.json @@ -53,7 +53,7 @@ "scripts": { "start": "npx directus start", "build": "rimraf dist && tsc --build && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist", - "dev": "cross-env DIRECTUS_DEV=true NODE_ENV=development ts-node-dev --inspect --files --transpile-only --respawn --watch \".env\" src/start.ts", + "dev": "cross-env DIRECTUS_DEV=true NODE_ENV=development ts-node-dev --files --transpile-only --respawn --watch \".env\" --inspect --require dotenv/config src/start.ts", "cli": "cross-env DIRECTUS_DEV=true NODE_ENV=development ts-node --script-mode --transpile-only src/cli/index.ts", "lint": "eslint \"src/**/*.ts\" cli.js index.js", "prepublishOnly": "npm run build",