-
Notifications
You must be signed in to change notification settings - Fork 32
add missing dep esbuild on init #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WesleyKapow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.