Skip to content

Guidance on using with Typescript and Yarn workspaces #265

Description

@mikkel-arturo

Hey there, Jetpack looks great and I am hoping to be able to use it after struggling with serverless-webpack for the last few days.

I have a typescript monorepo using yarn workspaces, and found this issue in which you say to build manually with a script. However, it's not clear how to configure this with Jetpack. Right now I have

package:
  include:
    - "**/dist/**"
    - "!**/node_modules/aws-sdk/**"
    - "!**/node_modules/@prisma/**"
    - "!**/node_modules/.prisma/**"
    - "!**/node_modules/typescript/**"
    - "!**/node_modules/.cache/**"

custom:
  jetpack:
    # Search for hoisted dependencies to one parent above normal.
    base: "../.."

This is including my entire hoisted node_modules folder (including aws-sdk, typescript, other dev dependencies, etc) and so is too large for lambda. Further, it's not clear how to connect it to the function.

Would it be:

functions:
  stripe:
    timeout: 30
    handler: dist/stripe-webhook.paymentIntentWebhook
    events:
      - http:
          path: '/webhooks/payment_intent'
          method: POST
          cors: true

???

Any guidance is much appreciated. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions