mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 16:26:01 +00:00
fix: try updating tsup.config to account for .tsx
This commit is contained in:
@@ -24,8 +24,7 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@app/*": ["./src/*"],
|
"@app/*": ["./src/*"]
|
||||||
"*": ["*", "*.tsx", "*.ts"]
|
|
||||||
},
|
},
|
||||||
"jsx": "react-jsx"
|
"jsx": "react-jsx"
|
||||||
},
|
},
|
||||||
|
|||||||
+13
-3
@@ -2,8 +2,8 @@
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
import { replaceTscAliasPaths } from "tsc-alias";
|
import {replaceTscAliasPaths} from "tsc-alias";
|
||||||
import { defineConfig } from "tsup";
|
import {defineConfig} from "tsup";
|
||||||
|
|
||||||
// Instead of using tsx or tsc for building, consider using tsup.
|
// Instead of using tsx or tsc for building, consider using tsup.
|
||||||
// TSX serves as an alternative to Node.js, allowing you to build directly on the Node.js runtime.
|
// TSX serves as an alternative to Node.js, allowing you to build directly on the Node.js runtime.
|
||||||
@@ -50,7 +50,17 @@ export default defineConfig({
|
|||||||
const isFile = await fs
|
const isFile = await fs
|
||||||
.stat(`${absPath}.ts`)
|
.stat(`${absPath}.ts`)
|
||||||
.then((el) => el.isFile)
|
.then((el) => el.isFile)
|
||||||
.catch((err) => err.code === "ENOTDIR");
|
.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 {
|
return {
|
||||||
path: isFile ? `${args.path}.mjs` : `${args.path}/index.mjs`,
|
path: isFile ? `${args.path}.mjs` : `${args.path}/index.mjs`,
|
||||||
|
|||||||
Reference in New Issue
Block a user