Skip to content

Exclude list? #202

Closed
Closed

Description

@janpio

Is there a way to influence @vercel/nft from the outside by providing a list of paths or files to ignore or exclude from the function dist, even though nft itself would decide to include it?

Unfortunately we sometimes have bugs (or unintended features) in Prisma that lead to big files wrongly being considered required, and then included in the serverless functions. This can also be triggerd by accident by users doing things in their codebase. Sometimes this even leads to the function archive getting to big for Vercel to upload it to AWS Lambda.

An exclude list would be a good workaround we could give our users temporarily to manually exclude some files or folders and unblock their deployments to Vercel functions.

Activity

  1. styfle commented on May 11, 2021

    @styfle
    Member
  2. janpio commented on May 11, 2021

    @janpio
    Author

    When I am the user of @vercel/nft myself that works.

    But can I influence that list when just deploying to Vercel (which uses @vercel/nft under the hood of course)? I would like to be able to tell a user "put this at x to make sure e.g. @primsa/engines is never included in your serverless function". Optimally I as a library/dependency author could do the same.

    (Serverless Framework for example supports patterns that define what to include or exclude from a "package": https://www.serverless.com/framework/docs/providers/aws/guide/packaging/)

  3. styfle commented on May 13, 2021

    @styfle
    Member

    Vercel deployments are typically zero config so we don't want to instruct every user to add config.

    I think its best to solve it once in the package (#203) than to make every user add config.

  4. styfle commented on May 13, 2021

    @styfle
    Member

    This also might be a good use case for conditions so the @primsa/engines package can declare different exports for development vs production.

  5. styfle commented on Jun 25, 2021

    @styfle
    Member

    I'm going to close this issue since nft already supports this use case though ignore option.

    Let me know if there is anything else we need here 👍

  6. lobsterkatie commented on Jul 25, 2022

    @lobsterkatie

    Vercel deployments are typically zero config so we don't want to instruct every user to add config.

    I think its best to solve it once in the package (#203) than to make every user add config.

    I agree that we don't want users to have to add config, but it would be nice if libraries could. One option would be to have NFT pick up on any files listed in webpack's external option, as that's literally someone saying "please don't bundle this."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions