From 179d03ef687cfc791893f7f242a836040220f42d Mon Sep 17 00:00:00 2001 From: Grant Robinson Date: Thu, 3 Dec 2020 11:16:37 -0700 Subject: [PATCH 1/3] Don't try to build non-Node functions When processing the async config, this will keep serverless-webpack from trying to create an entry for non-node functions. --- lib/validate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/validate.js b/lib/validate.js index a994606edd..1c0ca8c123 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -193,7 +193,11 @@ module.exports = { } // Lookup associated Serverless functions - const allEntryFunctions = _.map(this.serverless.service.getAllFunctions(), funcName => { + const allEntryFunctions = _.map(this.serverless.service.getAllFunctions().filter((funcName) => { + const func = this.serverless.service.getFunction(funcName); + const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs'; + return runtime.match(/node/); + }), funcName => { const func = this.serverless.service.getFunction(funcName); const handler = func.handler; const handlerFile = path.relative('.', getHandlerFile(handler)); From d551ae748d8407faf9d19c2f0ca6e2b17970785b Mon Sep 17 00:00:00 2001 From: Grant Robinson Date: Thu, 3 Dec 2020 11:20:52 -0700 Subject: [PATCH 2/3] Fixed indentation --- lib/validate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validate.js b/lib/validate.js index 1c0ca8c123..a09de8026d 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -196,7 +196,7 @@ module.exports = { const allEntryFunctions = _.map(this.serverless.service.getAllFunctions().filter((funcName) => { const func = this.serverless.service.getFunction(funcName); const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs'; - return runtime.match(/node/); + return runtime.match(/node/); }), funcName => { const func = this.serverless.service.getFunction(funcName); const handler = func.handler; From ff637fbaf0764e7b1499a515144886770a2bf89f Mon Sep 17 00:00:00 2001 From: Grant Robinson Date: Thu, 3 Dec 2020 11:33:37 -0700 Subject: [PATCH 3/3] fixed linting errors --- lib/validate.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/validate.js b/lib/validate.js index a09de8026d..7c77351004 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -193,20 +193,23 @@ module.exports = { } // Lookup associated Serverless functions - const allEntryFunctions = _.map(this.serverless.service.getAllFunctions().filter((funcName) => { + const allEntryFunctions = _.map( + _.filter(this.serverless.service.getAllFunctions(), funcName => { const func = this.serverless.service.getFunction(funcName); const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs'; return runtime.match(/node/); - }), funcName => { - const func = this.serverless.service.getFunction(funcName); - const handler = func.handler; - const handlerFile = path.relative('.', getHandlerFile(handler)); - return { - handlerFile, - funcName, - func - }; - }); + }), + funcName => { + const func = this.serverless.service.getFunction(funcName); + const handler = func.handler; + const handlerFile = path.relative('.', getHandlerFile(handler)); + return { + handlerFile, + funcName, + func + }; + } + ); this.entryFunctions = _.flatMap(entries, (value, key) => { const entry = path.relative('.', value);