Fork me on GitHub
#nbb
<
2022-07-07
>
borkdude15:07:21

Working on a bundler thing, which should make #nbb scripts work better when packaging them up for e.g Github Actions and perhaps other things like vercel or so.

$ node ../../lib/nbb_main.js bundle example.cljs > out.mjs
$ ncc build out.mjs
$ node dist/index.mjs
:promesa2
:utils
hello
[6 {:columns 204, :rows 48}]
6

😍 3
borkdude15:07:18

It's kind of like bb uberscript but for nbb

borkdude17:07:09

Updated the nbb-action-example now to use the new nbb bundle command: https://github.com/borkdude/nbb-action-example cc @delaguardo @cldwalker

awesome 1
borkdude17:07:44

@jayzawrotny Perhaps the bundle command will also help with the netlify stuff

jaide17:07:10

Will need to experiment. It is capable of running nbb at runtime for serverless functions

👍 1
borkdude18:07:46

Do we already have a link in the docs to your more elaborate netlify stuff?

jaide12:07:16

I don't think so. It's about ready, will bump the version and create a pleasing test page.

❤️ 1
borkdude21:07:40

OK, to finish off, I discovered one more nice thing about this bundle stuff. With webpack you can turn the .mjs (ESM) to normal .js https://github.com/babashka/nbb/tree/main/doc/bundle#webpack And then you can make that file executable, with a shebang and all that.

borkdude21:07:44

OK, one more cool thing. The webpack output can then be fed into pkg to create a standalone executable: https://github.com/babashka/nbb/tree/main/doc/bundle#pkg

1
1