Skip to content

Commit

Permalink
more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Nov 10, 2023
1 parent 0564f48 commit 6e4950d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/common/scripts/my-ts-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ function main() {
process.on("SIGINT", () => cleanupTempDirectory(tempDir));
process.on("SIGTERM", () => cleanupTempDirectory(tempDir));

// Canonicalize the file path
const filePath = require.resolve(fileToRun);

// Check that the input file exists
if (!existsSync(filePath)) {
console.error(`Error: Input file ${filePath} does not exist.`);
process.exit(1);
}
console.log("filePath", filePath);

// Run esbuild to bundle the TypeScript file
const esbuildProcess = runCommand("esbuild", [
"--sourcemap",
Expand All @@ -73,7 +83,7 @@ function main() {
"--bundle",
"--format=cjs",
"--platform=node",
fileToRun,
filePath,
"--outfile=" + outFile,
]);

Expand Down

0 comments on commit 6e4950d

Please sign in to comment.