Skip to content

Commit 41d5aac

Browse files
authored
Merge pull request #95 from Hilzu/feature/41/remove-dotenv
Replace dotenv with native --env-file
2 parents e1975a2 + df6ba75 commit 41d5aac

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

template/example.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
NODE_ENV=development
44
APP_ENV=local
55
PORT=3000
6-
DOTENV_CONFIG_QUIET=true

template/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"clean": "rimraf dist",
1717
"dev": "node --run clean && node --run build:ts && node --run dev-start",
1818
"dev-start": "concurrently --raw node:dev:*",
19-
"dev:app": "node --watch --watch-preserve-output --import ./dist/setup.js --enable-source-maps .",
19+
"dev:app": "node --watch --watch-preserve-output --import ./dist/setup.js --enable-source-maps --env-file .env .",
2020
"dev:build": "node --run build:ts -- --watch",
2121
"docker:build": "docker build --tag PROJECT_NAME .",
2222
"docker:run": "docker run --init --interactive --tty --publish 3000:3000 PROJECT_NAME",
@@ -25,7 +25,7 @@
2525
"format": "prettier --write .",
2626
"start": "node --import ./dist/setup.js --enable-source-maps .",
2727
"test": "concurrently --group node:test:* && node --run test-node",
28-
"test-node": "tsx --import ./test/shim.mjs --test --test-reporter spec \"src/**/*.test.ts\"",
28+
"test-node": "tsx --import ./test/shim.mjs --test --test-reporter spec --env-file .env \"src/**/*.test.ts\"",
2929
"test:format": "prettier --check .",
3030
"test:lint": "eslint .",
3131
"test:types": "tsc --noEmit --pretty"
@@ -35,7 +35,6 @@
3535
"@eslint/js": "^9.39.1",
3636
"@types/node": "^24.10.1",
3737
"concurrently": "^9.2.1",
38-
"dotenv": "^17.2.3",
3938
"eslint": "^9.39.1",
4039
"eslint-config-prettier": "^10.1.8",
4140
"eslint-plugin-n": "^17.23.1",

template/src/setup.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
// This file is loaded before anything else in the app
22
// Use this file to load environment variables and other global configuration
3-
4-
if (process.env.NODE_ENV !== "production") {
5-
const dotenv = await import("dotenv");
6-
dotenv.config();
7-
}

template/test/setup.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Common setup for all tests
2-
import dotenv from "dotenv";
32
import { after, before } from "node:test";
43

5-
dotenv.config();
6-
74
process.env.NODE_ENV = "test";
85

96
// Project modules must be dynamically imported after initializing the environment

0 commit comments

Comments
 (0)