and finally I was wondering : i think sst is build...
# help
l
and finally I was wondering : i think sst is building my lambda with esbuild. Is there a way to : bundle individually, declare externals ?
f
Yeah we definitely want to handle externals better. @Jay how should we do this? Should the
sst.Function
construct take an externals option?
l
that would be great. As I pointed out in one of your issues, i thing a global esbuild config could be passed on your Function construct. Maybe the build param could take either a bool or a config - that would map to esbuild config ? We do it in serverless-esbuild and add some logic around the declared externals.
f
Got it.. yeah we’ll probably be looking at the plugin code when we work on this 😄
@Loup Topalian Just released v0.9.17 with a couple of bundling options including
externalModules
. Here’s an example https://docs.serverless-stack.com/constructs/Function#configuring-bundling
l
Man, that is fast 😄 Have you been carefull to package the externals with the bundled function ? Do you control externals versions from node modules ? From the top yarn.lock (in case of a workspaced project) ?
anyways, kudos, and I'll try that soon
f
Yeah, it packages the externals with the versions from node modules, and respecting the yarn.lock/package-lock.json. And uses the corresponding packager.
It currently expects the lock file to be inside the
srcPath
l
ok, but then what about yarn workspace ?
because the lock file will be hoisted
f
Yeah, I’ll probably either traverse up or add an option to take the lock file path down the road.
l
that sounds like the way to do
f
Yeah.. I’m curious to see how many ppl use yarn workspaces with SST
l
in serverless-esbuild we give that option, and also infer workspace use
f
Ah I see
l
Well, I think SST is used in conjunction with monorepo pattern often, or I think it will be
and a monorepo pattern without worskpaces/lerna is just a huge pain
Down at freelance.com (we are seed customers too) I just refactored a bunch of projects to use workspace
And I am doing some POC to turn to CDK with SST (man, I can't take anymore yaml s***t)
f
LOL yeah.. we are in the middle of migrating Seed to SST as well
l
do you use a monorepo ?
f
yeah with Serverless Framework, most ppl have multiple services, so a monorepo is a must
l
exactly
and then workspace/lelrna is a must, otherwise you just end up with a massive amount of odd scripts to install cross deps, clear node modules, etC..
anyway, it's good you guys are moving fast. Are you a two person company ? Is SST going to benefit your recent YC acceleration ?
f
Yeah, it’s mostly @Jay and I on the dev side.
l
amazing, you seem to be coding quite fast
so you build seed alone ?