Skip to content

Commit 1c90816

Browse files
fix: SLS monorepo (#69)
1 parent 143d74d commit 1c90816

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/frameworks/slsFramework.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class SlsFramework implements IFramework {
127127
} catch (error: any) {
128128
Logger.error('Error loading serverless modules', error);
129129
Logger.log(
130-
'If you are running Lambda Live Debugger from a global installation, install Serverless Framework globally as well.',
130+
'If you are running Lambda Live Debugger from a global installation, install Serverless Framework globally as well. If you are using monorepo, install Serverless Framework also in the project root folder.',
131131
);
132132
throw new Error(`Error loading serverless modules. ${error.message}`, {
133133
cause: error,
@@ -211,8 +211,10 @@ export class SlsFramework implements IFramework {
211211

212212
const lambdasDiscovered: LambdaResource[] = [];
213213

214-
const esBuildOptions: EsBuildOptions | undefined =
215-
this.getEsBuildOptions(serverless);
214+
const esBuildOptions: EsBuildOptions | undefined = this.getEsBuildOptions(
215+
serverless,
216+
config,
217+
);
216218

217219
const lambdas = serverless.service.functions;
218220

@@ -270,7 +272,8 @@ export class SlsFramework implements IFramework {
270272
return lambdasDiscovered;
271273
}
272274

273-
protected getEsBuildOptions(serverless: Serverless) {
275+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
276+
protected getEsBuildOptions(serverless: Serverless, config: LldConfigBase) {
274277
// 1) Get from from LLD specific options in custom.lldEsBuild
275278
let esBuildOptions: EsBuildOptions | undefined =
276279
serverless.service.custom?.lldEsBuild;
@@ -302,7 +305,7 @@ export class SlsFramework implements IFramework {
302305
const settings = serverless.service.custom?.serverlessPluginTypescript;
303306
if (settings) {
304307
esBuildOptions = {
305-
tsconfig: settings.tsConfigFileLocation,
308+
tsconfig: path.resolve(settings.tsConfigFileLocation),
306309
};
307310
}
308311
}

0 commit comments

Comments
 (0)