does sst use webpack under the hood for all lambda...
# sst
h
does sst use webpack under the hood for all lambda functions?
t
no we use esbuild
h
ok, I'm trying to use knex as a query builder and there is a known problem where it doesn't exclude unused database drivers (e.g. 'ps', 'mysql', 'sqlite3') and causes the bundler to throw a fit
is there anywhere I would mark external libraries for esbuild?
t
yep on the function definition you can set
bundle.external = ["pg", "mysql"]
we also have
bundle.nodeModules
which will mark as external but also install the package into the lambda before uploading
h
bundle.external goes inside the function definition or in the global scope?
t
you can also use app.setDefaultFunctionProps if you want to set it globally
h
Yeah i just reazlied its in the stack definition and changed it in the API construct
you guys rock
saving my life