cspotcode
cspotcode
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
> bun build --compile --minify --bytecode --outfile helloworld-bun-bytecode.exe .\helloworld.ts
[42ms] minify
[145ms] bundle 1 modules
[316ms] compile helloworld-bun-bytecode.exe
> ls

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 1/27/2025 10:40 AM 111054004 helloworld-bun-bytecode.exe
-a--- 1/26/2025 8:25 PM 111051947 helloworld-bun.exe
-a--- 1/26/2025 8:25 PM 77769961 helloworld-deno.exe
> bun build --compile --minify --bytecode --outfile helloworld-bun-bytecode.exe .\helloworld.ts
[42ms] minify
[145ms] bundle 1 modules
[316ms] compile helloworld-bun-bytecode.exe
> ls

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 1/27/2025 10:40 AM 111054004 helloworld-bun-bytecode.exe
-a--- 1/26/2025 8:25 PM 111051947 helloworld-bun.exe
-a--- 1/26/2025 8:25 PM 77769961 helloworld-deno.exe
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
Does it minify the bytecode of only the code that I'm bundling, so only the single console.log("Hello world") in my example?
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
And what difference do you think it would make in my example, where I built a hello world app? Because the code was a single console.log statement without any imports
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
Ok, to clarify, which part of this is deno not doing? "All imported files and packages are bundled into the executable, along with a copy of the Bun runtime." In my example, I believe that deno is bundling the imported files and packages into the executable. It also includes the runtime, because that's how it executes.
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
Yes it does, that's the goal. You can also see in my example, it bundled the hello world script.
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
to be honest I did not expect such a big difference
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
Informal test, on Windows, I created a Hello World single-file executable with both Bun and Deno Deno's executable is way smaller, 70% the size of Bun's
> deno compile --output helloworld-deno.exe .\helloworld.ts
Check file:///C:/.../helloworld.ts
Compile file:///C:/.../helloworld.ts to helloworld-deno.exe

Embedded Files

helloworld-deno.exe
├── helloworld.ts (142B)
└── package.json (4B)

Size: 146B

> bun build --compile --outfile helloworld-bun.exe .\helloworld.ts
[13ms] bundle 1 modules
[141ms] compile helloworld-bun.exe
>
> ls

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 1/26/2025 8:25 PM 111051947 helloworld-bun.exe
-a--- 1/26/2025 8:25 PM 77769961 helloworld-deno.exe
> deno compile --output helloworld-deno.exe .\helloworld.ts
Check file:///C:/.../helloworld.ts
Compile file:///C:/.../helloworld.ts to helloworld-deno.exe

Embedded Files

helloworld-deno.exe
├── helloworld.ts (142B)
└── package.json (4B)

Size: 146B

> bun build --compile --outfile helloworld-bun.exe .\helloworld.ts
[13ms] bundle 1 modules
[141ms] compile helloworld-bun.exe
>
> ls

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 1/26/2025 8:25 PM 111051947 helloworld-bun.exe
-a--- 1/26/2025 8:25 PM 77769961 helloworld-deno.exe
94 replies
DDeno
Created by aufhebung substance on 1/26/2025 in #help
Why deno.exec is much larger than bun.exec
How does a single-file executable compare for each? Since those don't include things like the LSP?
94 replies
DDeno
Created by cspotcode on 1/19/2025 in #help
How do deno devs bundle .js for browser projects? (SPAs, chrome extensions, etc)
so I get all the benefits of a nice CLI: --watch, etc
9 replies
DDeno
Created by cspotcode on 1/19/2025 in #help
How do deno devs bundle .js for browser projects? (SPAs, chrome extensions, etc)
Thanks, does that require writing my own .ts file to do building? I was hoping to run a CLI, an esbuild invocation in my justfile / makefile, or something like that.
9 replies
DDeno
Created by cspotcode on 10/16/2024 in #help
Tools to shrink the output of deno compile?
since deno.exe is 107MB
6 replies
DDeno
Created by cspotcode on 10/16/2024 in #help
Tools to shrink the output of deno compile?
I'm guessing the 80MB is already a compile-specific build of deno with all the CLI tooling stripped out, deno fmt, deno install, etc?
6 replies
DDeno
Created by cspotcode on 10/16/2024 in #help
Tools to shrink the output of deno compile?
No description
6 replies
DDeno
Created by cspotcode on 10/16/2024 in #help
Tools to shrink the output of deno compile?
This blog says 1.41 shrank the binaries from ~116MB to ~58MB, but deno 2 .exes are ~80MB https://deno.com/blog/v1.41#smaller-deno-compile-binaries
6 replies
DDeno
Created by cspotcode on 10/12/2024 in #help
JSR publish: source .ts or transpiled .js w/sourcemaps?
So: publish .ts to JSR, do not compile it
3 replies
DDeno
Created by cspotcode on 10/12/2024 in #help
JSR publish: source .ts or transpiled .js w/sourcemaps?
Nevermind, figured it out by publishing a module to JSR, though it wasn't immediately clear from jsr docs: JSR accepts your source .ts, renders docs from it, and automatically generates .js and .d.ts
3 replies