diff --git a/.changeset/eleven-plants-do.md b/.changeset/eleven-plants-do.md new file mode 100644 index 0000000..5c37c1a --- /dev/null +++ b/.changeset/eleven-plants-do.md @@ -0,0 +1,5 @@ +--- +"@hyperse/ts-node-paths": patch +--- + +Remove autoload `.env`, avoid other library(like `next.js`) depends `.env` with load order diff --git a/package.json b/package.json index be2819a..1390814 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ }, "dependencies": { "colorette": "^2.0.20", - "dotenv": "^16.4.5", "get-tsconfig": "^4.7.5", "pkg-up": "^5.0.0", "ts-node": "11.0.0-beta.1", diff --git a/src/path-alias.ts b/src/path-alias.ts index 3ca3982..4d9eb9c 100644 --- a/src/path-alias.ts +++ b/src/path-alias.ts @@ -1,12 +1,8 @@ -import { config } from 'dotenv'; import { fileURLToPath } from 'node:url'; import { HYPERSE_TS_NODE, HYPERSE_TS_NODE_PATHS } from './constants.js'; import { Tsconfig } from './tsconfig/index.js'; import { CompilerOptions } from './types/tsconfig.js'; -// Parses the *.env file -config(); - class PathAlias { #opts: CompilerOptions; get opts(): CompilerOptions { diff --git a/yarn.lock b/yarn.lock index e330055..237ece1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -945,7 +945,6 @@ __metadata: colorette: "npm:^2.0.20" commitizen: "npm:4.3.0" cz-conventional-changelog: "npm:3.3.0" - dotenv: "npm:^16.4.5" eslint: "npm:^9.3.0" execa: "npm:^9.1.0" get-tsconfig: "npm:^4.7.5" @@ -3006,13 +3005,6 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.4.5": - version: 16.4.5 - resolution: "dotenv@npm:16.4.5" - checksum: 10/55a3134601115194ae0f924e54473459ed0d9fc340ae610b676e248cca45aa7c680d86365318ea964e6da4e2ea80c4514c1adab5adb43d6867fb57ff068f95c8 - languageName: node - linkType: hard - "dotenv@npm:^8.1.0": version: 8.6.0 resolution: "dotenv@npm:8.6.0"