mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 08:28:52 +00:00
fix: try updating tsup.config to account for .tsx
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
"skipLibCheck": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@app/*": ["./src/*"],
|
||||
"*": ["*", "*.tsx", "*.ts"]
|
||||
"@app/*": ["./src/*"]
|
||||
},
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
|
||||
@@ -49,8 +49,18 @@ export default defineConfig({
|
||||
|
||||
const isFile = await fs
|
||||
.stat(`${absPath}.ts`)
|
||||
.then((el) => el.isFile)
|
||||
.catch(async (err) => {
|
||||
if (err.code === "ENOTDIR") {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If .ts file doesn't exist, try checking for .tsx file
|
||||
return fs
|
||||
.stat(`${absPath}.tsx`)
|
||||
.then((el) => el.isFile)
|
||||
.catch((err) => err.code === "ENOTDIR");
|
||||
});
|
||||
|
||||
return {
|
||||
path: isFile ? `${args.path}.mjs` : `${args.path}/index.mjs`,
|
||||
|
||||
Reference in New Issue
Block a user