Skip to content

Commit

Permalink
fix: enforce .tsx file extension for dev command (#47)
Browse files Browse the repository at this point in the history
* fix: enforce .tsx file extension for dev command

* Update cli/dev/register.ts

* chore: format

---------

Co-authored-by: Severin Ibarluzea <[email protected]>
  • Loading branch information
kom-senapati and seveibar authored Feb 1, 2025
1 parent 59cbd1f commit 3964d71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/dev/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const registerDev = (program: Command) => {

if (file) {
absolutePath = path.resolve(file)
if (!absolutePath.endsWith(".tsx")) {
console.error("Error: Only .tsx files are supported")
return
}
} else {
const entrypointPath = path.resolve("index.tsx")
if (fs.existsSync(entrypointPath)) {
Expand Down

0 comments on commit 3964d71

Please sign in to comment.