Skip to content

Commit

Permalink
feat(dev-server-esbuild): allow extended tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
venikx committed Mar 16, 2023
1 parent 8fe22a7 commit 4fc32b2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/dev-server-esbuild/src/EsbuildPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Loader, Message, transform } from 'esbuild';
import { promisify } from 'util';
import path from 'path';
import fs from 'fs';
import child_process from 'child_process';
import {
queryAll,
predicates,
Expand Down Expand Up @@ -61,7 +62,15 @@ export class EsbuildPlugin implements Plugin {
this.config = config;
this.logger = logger;
if (this.esbuildConfig.tsconfig) {
this.tsconfigRaw = await promisify(fs.readFile)(this.esbuildConfig.tsconfig, 'utf8');
try {
const { stderr, stdout } = await promisify(child_process.exec)(
`tsc --project ${this.esbuildConfig.tsconfig} --showConfig`,
);
if (stderr) throw stderr;
this.tsconfigRaw = stdout;
} catch (e) {
console.error(e);
}
}
}

Expand Down

0 comments on commit 4fc32b2

Please sign in to comment.