Skip to content

Commit

Permalink
esbuild-plugin-typecheck: Fix relative 'extends' usage
Browse files Browse the repository at this point in the history
Fixes #109
  • Loading branch information
jgoz committed May 11, 2024
1 parent 9976307 commit 43765db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-carpets-play.md
@@ -0,0 +1,5 @@
---
"@jgoz/esbuild-plugin-typecheck": patch
---

Use proper basePath for relative 'extends' config
4 changes: 2 additions & 2 deletions packages/esbuild-plugin-typecheck/src/typescript-worker.ts
@@ -1,7 +1,7 @@
import type { Message } from 'esbuild';
import * as realFS from 'fs';
import { fs as memfs } from 'memfs';
import { dirname } from 'path';
import path, { dirname } from 'path';
import ts from 'typescript';
import { ufs } from 'unionfs';
import type { MessagePort } from 'worker_threads';
Expand Down Expand Up @@ -204,7 +204,7 @@ function startWorker(options: TypescriptWorkerOptions, port: MessagePort) {
const { config } = ts.readConfigFile(configFile, ts.sys.readFile);
config.compilerOptions = { ...config.compilerOptions, ...options.compilerOptions };

const commandLine = ts.parseJsonConfigFileContent(config, ts.sys, basedir);
const commandLine = ts.parseJsonConfigFileContent(config, ts.sys, path.dirname(configFile));
const build = options.build ?? commandLine.options.composite ?? false;

const { options: compilerOptions } = commandLine;
Expand Down

0 comments on commit 43765db

Please sign in to comment.