Skip to content

Commit

Permalink
bundle: check cwd for tsconfig
Browse files Browse the repository at this point in the history
fix tsconfig resolution
  • Loading branch information
Aylur committed Nov 11, 2024
1 parent 0865e8c commit fe56428
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/esbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func Bundle(infile, outfile, tsconfig string) {
srcdir := filepath.Dir(infile)

if tsconfig != "" {
// if a tsconfig file is specified use that
path, err := filepath.Abs(tsconfig)
if err != nil {
Err(err)
Expand All @@ -137,7 +138,16 @@ func Bundle(infile, outfile, tsconfig string) {
}

tsconfig = string(data)

} else if FileExists("tsconfig.json") {
cwd, err := os.Getwd()
if err != nil {
Err(err)
}

tsconfig = GetTsconfig(cwd)
} else {
// fallback to default
tsconfig = GetTsconfig(srcdir)
}

Expand Down

0 comments on commit fe56428

Please sign in to comment.