-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Non node functions are attempted to be packaged #808
Changes from all commits
cbb5456
6d60fc6
af1475a
d752b84
2bee345
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -139,7 +139,12 @@ module.exports = { | |||||||||
|
||||||||||
// Copy artifacts to package location | ||||||||||
if (isIndividialPackaging.call(this)) { | ||||||||||
_.forEach(functionNames, funcName => copyArtifactByName.call(this, funcName)); | ||||||||||
const nodeFunctionNames = _.filter(functionNames, funcName => { | ||||||||||
const func = this.serverless.service.getFunction(funcName); | ||||||||||
const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs'; | ||||||||||
return runtime.match(/node/); | ||||||||||
Comment on lines
+143
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you create a separate function to re-use this code from line 217? const isNodeRuntime = funcName => {
const func = this.serverless.service.getFunction(funcName);
const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs';
return runtime.match(/node/);
}; And then, re-use it here (and when we build the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another option might be to add something like a |
||||||||||
}); | ||||||||||
_.forEach(nodeFunctionNames, funcName => copyArtifactByName.call(this, funcName)); | ||||||||||
} else { | ||||||||||
// Copy service packaged artifact | ||||||||||
const serviceName = this.serverless.service.getServiceObject().name; | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same
nodeFunctionNames
would also need to be used below in lines 149 (previously 154) and 165 (previously 160) to avoid serverless-webpack still overriding the artifact path of the given function.