From 1b7f47fc5356a65106bcded04bcdb73a2d883ebc Mon Sep 17 00:00:00 2001 From: timo92 Date: Thu, 18 Jul 2024 10:50:32 +0200 Subject: [PATCH] fix: Deployment using serverless-compose --- src/resources/Schema.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/resources/Schema.ts b/src/resources/Schema.ts index 916c3fc3..3bfb8af0 100644 --- a/src/resources/Schema.ts +++ b/src/resources/Schema.ts @@ -58,13 +58,11 @@ export class Schema { } generateSchema() { - const schemaFiles = flatten(globby.sync(this.schemas)); + const cwd = this.api.plugin.serverless.config.servicePath; + const schemaFiles = flatten(globby.sync(this.schemas, { cwd })); const schemas = schemaFiles.map((file) => { - return fs.readFileSync( - path.join(this.api.plugin.serverless.config.servicePath, file), - 'utf8', - ); + return fs.readFileSync(path.join(cwd, file), 'utf8'); }); this.valdiateSchema(AWS_TYPES + '\n' + schemas.join('\n'));