Conversation
WesleyKapow
left a comment
There was a problem hiding this comment.
I had to add esbuild manually. This would have saved me that debug step.
|
What do you mean by this?
This enables 'debugging' the index.ts files? |
|
If your run the setup and select So today, each people running the setup selecting This PR fix this. (not related to debugging.) |
|
You probably have |
|
Yeah, must have. I have other 'real' |
|
A better solution is to properly find a path of esbuild and run it from there, since it's already installed in aocrunner. There's no need to install in template too.
import { spawnSync } from "child_process"
import path from "path"
+import { fileURLToPath } from "url"
const buildSource = (input: string | string[], sourcemap: boolean = true) => {
const files = Array.isArray(input) ? input : [input]
const outDir = Array.isArray(input)
? "dist"
: path.parse(input).dir.replace(/^src/, "dist")
console.log("Transpiling...\n")
+ const esbuild = fileURLToPath(import.meta.resolve("esbuild/bin/esbuild"))
spawnSync(
"npx",
[
- "esbuild",
+ esbuild,
...files,
"--format=esm",
`--outdir=${outDir}`,
"--platform=node",
"--target=node16",
...(sourcemap ? ["--sourcemap"] : []),
],
{ stdio: "inherit", shell: true },
)
}
export default buildSourceI tested it with node 22 (bumped all deps) and pnpm in both |

No description provided.