deno icon indicating copy to clipboard operation
deno copied to clipboard

deno compile [--lite] [--static] ...

Open ealib opened this issue 4 years ago • 12 comments

Feature request: compile JS/TS scripts with no dependency. To be used in IoT, IIoT, embedded devices etc.

ealib avatar May 05 '21 14:05 ealib

In 1.10.2, deno compile is no --lite option. 😞

iugo avatar May 21 '21 06:05 iugo

I also noticed that the —lite option has gone missing. I could not find any mention of that on the release notes. Is this a bug or was there a conscious decision to remove this? Final binary size is a concern for many types of applications (iot, cli), and I would certainly appreciate to see it back.

JohannesRudolph avatar Jun 09 '21 07:06 JohannesRudolph

Removing lite binaries was a conscious decision. iirc it increased build time by too much.

MierenManz avatar Jun 09 '21 07:06 MierenManz

Feature request: compile JS/TS scripts with no dependency

What do you mean by no dependency? Using deno compile you already get a self-contained executable that has exactly same requirements as running deno itself.

bartlomieju avatar Jun 26 '21 01:06 bartlomieju

@MierenManz did it increase the compile time for non-lite builds?

I think having a longer compile time is a reasonable tradeoff if you want to ship the smallest binary possible.

dlight avatar Aug 10 '21 23:08 dlight

Ah, I just bumped into this as well. Being able to generate smaller binaries is killer for dealing with more constrained environments. Anybody have any idea if this might be feasible anytime soon?

jabyrd3 avatar Oct 27 '21 23:10 jabyrd3

Ah, so the "build times" referenced up-thread weren't end-user binary build-times, but denos CI, that makes more sense. https://github.com/denoland/deno/pull/10350

I wouldn't mind building denort from source for this, can we provide an alternate deno binary to deno compile for it to pack?

jabyrd3 avatar Oct 27 '21 23:10 jabyrd3

I wouldn't mind building denort from source for this, can we provide an alternate deno binary to deno compile for it to pack?

I think it's a good compromise, I'm willing to accept a PR that adds a flag to custom binary.

bartlomieju avatar Oct 28 '21 07:10 bartlomieju

@bartlomieju sorry I meant "no dependency = static linking". Maybe easier to have a statically linked Deno first.

ealib avatar Nov 02 '21 09:11 ealib

would it be possible to have a lite-binary by utilizing system-bundled js-runtimes, a la https://neutralino.js.org ?

this should reduce file-sizes even further without increasing build-time?

max-pub avatar Mar 15 '22 07:03 max-pub

What's the status on this issue? I'm building a CLI app on deno and i'd like to ship a binary

v1rtl avatar May 19 '23 08:05 v1rtl

What's the status on this issue? I'm building a CLI app on deno and i'd like to ship a binary

Sorry, I started a new job and completely ran out of free time to mess around. someday i'd like to revisit this (and deno, in general), but for the time-being I'm stuck in nodeland. tiny deno binaries in an extremely minimal container will be veryvery nice

jabyrd3 avatar Jan 20 '24 01:01 jabyrd3