You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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."
Activity
styfle commentedon May 11, 2021
There is an
ignoreoption you can use here:https://github.com/vercel/nft/blob/main/readme.md#ignore
janpio commentedon May 11, 2021
When I am the user of
@vercel/nftmyself that works.But can I influence that list when just deploying to Vercel (which uses
@vercel/nftunder the hood of course)? I would like to be able to tell a user "put this at x to make sure e.g.@primsa/enginesis 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/)
styfle commentedon May 13, 2021
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.
styfle commentedon May 13, 2021
This also might be a good use case for
conditionsso the@primsa/enginespackage can declare different exports for development vs production.styfle commentedon Jun 25, 2021
I'm going to close this issue since
nftalready supports this use case though ignore option.Let me know if there is anything else we need here 👍
lobsterkatie commentedon Jul 25, 2022
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
externaloption, as that's literally someone saying "please don't bundle this."