support for .jsx & .tsx files

This commit is contained in:
SrGooglo 2023-05-24 17:43:18 +00:00
parent 4a2820597c
commit 3ab7b24d7d

View File

@ -10,7 +10,7 @@ function createRoutesFromDirectory(startFrom, directoryPath, router) {
if (stat.isDirectory()) {
createRoutesFromDirectory(startFrom, filePath, router)
} else if (file.endsWith(".js")) {
} else if (file.endsWith(".js") || file.endsWith(".jsx") || file.endsWith(".ts") || file.endsWith(".tsx")) {
let splitedFilePath = filePath.split("/")
// slice the startFrom path