serverless-SAM-typescript-boilerplate
serverless-SAM-typescript-boilerplate copied to clipboard
Update webpack.config.ts so that npm run build:prod works
Without this change, the template throws a build error:
const entries = Object.values(resources)
^
TypeError: Cannot convert undefined or null to object
this is because the variable extraction from the yamlParse call is case-sensitive. Actual output of yamlParse:
{
AWSTemplateFormatVersion: '2010-09-09',
Transform: 'AWS::Serverless-2016-10-31',
Description: 'hellword-api',
Globals: { Function: { Timeout: 60 } },
Resources: {
GlobalDependenciesLayer: {
Type: 'AWS::Serverless::LayerVersion',
Properties: [Object],
Metadata: [Object]
},
GlobalApiResponsesLayer: {
Type: 'AWS::Serverless::LayerVersion',
Properties: [Object],
Metadata: [Object]
},
GreetingFunction: { Type: 'AWS::Serverless::Function', Properties: [Object] }
}
}
Ah, I see https://github.com/Borduhh/serverless-SAM-typescript-boilerplate/pull/1 has already addressed this!