Skip to content

Commit

Permalink
also support dist folder for main.[js,ts,jsx,tsx]
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Jan 28, 2025
1 parent c7cc1d2 commit 2c26d55
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ func (me *App) Dir() string {
}

for _, candidate := range []string{"main.js", "main.ts", "main.jsx", "main.tsx"} {
path := filepath.Join(dir, candidate)
if utils.FileExists(path) {
if utils.FileExists(filepath.Join(dir, candidate)) {
return dir
}
}

for _, candidate := range []string{"main.js", "main.ts", "main.jsx", "main.tsx"} {
if utils.FileExists(filepath.Join(dir, "dist", candidate)) {
return filepath.Join(dir, "dist")
}
}

if utils.FileExists(filepath.Join(dir, "dist", "index.html")) {
return filepath.Join(dir, "dist")
}
Expand Down

0 comments on commit 2c26d55

Please sign in to comment.