Trying to copy-edit while distracted didn't work well last night

This commit is contained in:
R Tyler Croy 2019-04-05 06:43:14 -07:00
parent 840d3fa4a7
commit 7273d48dec
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
1 changed files with 16 additions and 15 deletions

View File

@ -6,27 +6,28 @@ tags:
- javascript
---
The ability to shamelessly ask stupid questions has has led me to numerous
interesting projects and in some case truly novel solutions. I'm certainly the
subject of this blog post at least fits into the first part of that equation. I
find the single static binaries produced by Rust and Golang to be compelling
for system utilities, at the same time however I am quite fond of writing
The ability to shamelessly ask stupid questions has led me to numerous
interesting projects and in some cases truly novel solutions. The
subject of this blog post fits into the first part of that equation at least. I
find the single static binaries produced by Rust and Golang to be quite compelling
for system utilities, at the same time however I am fond of writing
TypeScript. Why can't I mix chocolate with my peanut butter?
You kinda can! And it kinda works!
I first started tinkering with a tool I was aware of from goofy hacking months
I first started tinkering with a tool which I discovered while goofy-hacking months
ago: [nexe](https://github.com/nexe/nexe). Nexe helps turn Node applications
into single static binaries with an embedded runtime. I had issue with newer
style imports working properly with the system Nexe uses to build bundles, so I
went looking around for other options. Eventually I stumbled into [Pkg](https://github.com/zeit/pkg) which worked quite well!
into single static binaries with an embedded Node runtime. I had issues with
newer style imports, which weren't working properly with the system Nexe uses
to build its bundles. I went looking around for other options. Eventually I
stumbled into [Pkg](https://github.com/zeit/pkg) which worked quite well!
Using `pkg` with TypeScript ended up working with the simple addition of a
`tsc` invocation before invoking `pkg` with the `build/` directory containing
the output JavaScript files.
I have suspicions that `pkg` won't work effectively with some Node packages
that include native code, but haven't yet walked into that minefield.
Combining `pkg` with TypeScript works with the simple addition of a `tsc`
invocation before calling `pkg`. Passing in the `build/` directory containing the
compiled JavaScript files, everything "just works" and a 30-ish megabyte single
static binary is generated. I have a suspicion that `pkg` won't work effectively
with Node packages that include native code, but haven't yet walked into that
minefield.
---