Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

chore: upgrade get-tsconfig #36

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@esbuild-kit/core-utils": "^3.1.0",
"get-tsconfig": "^4.4.0"
"get-tsconfig": "^4.7.0"
},
"devDependencies": {
"@pvtnbr/eslint-config": "^0.33.0",
Expand Down
19 changes: 12 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ import {
parseTsconfig,
createPathsMatcher,
createFilesMatcher,
TsConfigResult,
} from 'get-tsconfig';
import type { TransformOptions } from 'esbuild';

const isPathPattern = /^\.{0,2}\//;
const isTsFilePatten = /\.[cm]?tsx?$/;
const nodeModulesPath = `${path.sep}node_modules${path.sep}`;

const tsconfigCache = new Map<string, TsConfigResult>();
const tsconfig = (
process.env.ESBK_TSCONFIG_PATH
? {
path: path.resolve(process.env.ESBK_TSCONFIG_PATH),
config: parseTsconfig(process.env.ESBK_TSCONFIG_PATH),
npdev453 marked this conversation as resolved.
Show resolved Hide resolved
}
: getTsconfig()
: getTsconfig(undefined, undefined, tsconfigCache)
);

const fileMatcher = tsconfig && createFilesMatcher(tsconfig);
Expand Down