I started doing the latter as I needed it for my s...
# sst
t
My intent was to do both but I didn't implement the install step. I probably should have called this
externalModules
instead of
nodeModules
f
yeah I see. do you just need
externalModules
for now?
t
Yeah but I'm using the commandHooks.afterBundling in my stack to copy over some additional files from my local node_modules
Prisma is weird
So
externalModules
+
commandHooks
would solve everything for me
f
yeah for that.. i’m thinking of putting in a copyFiles option for that
and leave commandHooks to later
would that work for u?
t
Potentially depending on the API
Copy code
commandHooks: {
          afterBundling(_input, output) {
            execSync(`cp -a prisma ${output}`)
          },
        },
f
maybe something along the line of
Copy code
copyFiles: {
  from: 'node_modules/.prisma',
  to: output
}
t
yeah that should work - maybe as an array for multiple files
Ah you know what, the complexity I had was making sure intermediate paths were created
so copy from
node_modules/@prisma/client
to
output/node_modules/@prisma
That should create any paths that don't exist ideally
f
ah i see.. you mean the parent directory might not existed right?
t
yeah
I think it's really just calling
mkdir -p
on the target directory
f
@thdxr Just released v0.9.17 with a couple of bundling options. Here’s an example https://docs.serverless-stack.com/constructs/Function#configuring-bundling
t
Amazing! Will check it out today