Ross Coundon
11/05/2021, 7:33 AMError: Bundle cannot be disabled for the "AuthorizerFunction" function since the "srcPath" is set to the project root. Read more here — <https://github.com/serverless-stack/serverless-stack/issues/78>
Looking at the github issue I'm confused as to how to workaround this. Shifting my src
down a level doesn't make any difference. Does the code need to live in an entirely different folder structure for this to work?Ross Coundon
11/07/2021, 10:16 AMFrank
bundle
so that the functions do not get built by esbuild?Ross Coundon
11/08/2021, 7:24 AMFrank
bundle
is set to false
, the function gets built by esbuild with all the dependencies set as external modules. So esbuild is not following and building the imports, and the built file is zipped up with the entire srcPath
(including the nodeModules
). https://docs.serverless-stack.com/constructs/Function#bundleFrank
bundle: false
, the code still goes through esbuild
. Will that work for Thundra?Ross Coundon
11/08/2021, 4:59 PMSerkan Özal
11/08/2021, 5:03 PMSerkan Özal
11/08/2021, 5:04 PMFrank
Frank
bundle: false
a try before the esbuild plugin is ready, you can give it a quick try by creating a test function inside (ie. /test-function/lambda.js
), and define the function like this:
new Function(this, "MyTESTLambda", {
bundle: false,
srcPath: "test-function/",
handler: "lambda.main",
});
Frank
bundle
is disabled, srcPath
cannot be project root (default is the root) due to how SST current zips up the directory. We have an open issue to support it https://github.com/serverless-stack/serverless-stack/issues/78.Frank
bundle: false
works.