Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
fix: bundling with multiple dots in filename (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianSchon authored Oct 11, 2024
1 parent e87ee87 commit 1bf0370
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/runtime/node/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ func (r *Runtime) Build(ctx context.Context, input *runtime.BuildInput) (*runtim
if err != nil {
return nil, err
}
target := filepath.Join(input.Out(), strings.ReplaceAll(rel, filepath.Ext(rel), extension))

fileName := strings.TrimSuffix(filepath.Base(rel), filepath.Ext(rel))
// Lambda handler can only contain 1 dot separating the file name and function name
fileName = strings.ReplaceAll(fileName, ".", "-")
handler := fileName + filepath.Ext(input.Handler)
target := filepath.Join(input.Out(), fileName+extension)
slog.Info("loader info", "loader", properties.Loader)

loader := map[string]esbuild.Loader{}
Expand Down Expand Up @@ -229,7 +233,7 @@ func (r *Runtime) Build(ctx context.Context, input *runtime.BuildInput) (*runtim
}

return &runtime.BuildOutput{
Handler: input.Handler,
Handler: handler,
Errors: errors,
}, nil
}

0 comments on commit 1bf0370

Please sign in to comment.