Ncc: Shipping externalized native deps

Created on 29 Jan 2019  ยท  3Comments  ยท  Source: vercel/ncc

Hey all!

I'm looking to ship a package that's been run through ncc that includes a native dep (zeromq). The current support is great, as I get a nice tidy little collection:

dist$ tree -h
.
โ”œโ”€โ”€ [  96]  build
โ”‚   โ””โ”€โ”€ [  96]  Release
โ”‚       โ””โ”€โ”€ [1.1M]  zmq.node
โ”œโ”€โ”€ [  11]  index.d.ts
โ”œโ”€โ”€ [5.1M]  index.js
โ””โ”€โ”€ [ 263]  server.d.ts

That zmq.node is specific to the node it's being run on (yes, yes, zeromq is looking to switch to N-API). Luckily, zeromq ships prebuilds for each platform that we can install / have available. We can write a postinstall that will place the zeromq prebuilds in build/Release/zmq.node, that's no problem.

What I'm wondering about is if there could be some way to ease this / create a paved path for working with native deps & ncc.

enhancement

Most helpful comment

Yep, we (zeromq) already ship prebuilds so if there's a nice way for ncc to support prebuilds then I'm happy. ๐Ÿ˜„

All 3 comments

This is definitely an interesting area that could be explored further. I wonder if there could be a way to integrate something like prebuild (https://github.com/prebuild/prebuild) with such a workflow.

@TooTallNate would value your thoughts here too.

I guess if zeromq is already shipping prebuilds the point is that it's just about supporting the prebuilds in the ncc build. That is definitely something we could support here.

Yep, we (zeromq) already ship prebuilds so if there's a nice way for ncc to support prebuilds then I'm happy. ๐Ÿ˜„

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrmckeb picture mrmckeb  ยท  5Comments

j picture j  ยท  3Comments

maku picture maku  ยท  3Comments

tmtron picture tmtron  ยท  5Comments

hrueger picture hrueger  ยท  4Comments