Fork me on GitHub
#squint
<
2023-10-03
>
Omar18:10:02

I've essentially paid zero attention to npm config and tooling. What's the quickest way to just get a single bundled js file that I can throw in my project? Decided I'll most likely use this to continue adding functionality to my PWA service-worker instead of using cljs or plain js as I'm using now.

Omar18:10:40

paid so little attention to things in the JS world that the squint compilation output is the first time I've seen the michael jackson extension

Omar18:10:11

Checked the example folder and found this, seems to work well:

npx esbuild main.mjs --bundle --minify --platform=node --outfile=main.min.mjs --format=esm
I'm shocked how small the builds are, extremely happy this exists!

borkdude20:10:19

yes, esbuild works well to produce a single file

borkdude20:10:35

mjs = short for ESM js

borkdude20:10:47

node wants this extension if you're using import etc

borkdude20:10:59

you can tweak the extension with --extension=js

zane21:10:54

+1 for esbuild.