-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python] ignore nested node_modules
, .next
, .nuxt
, .git
& .vercel
#12807
Conversation
🦋 Changeset detectedLatest commit: 8faf079 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
: [ | ||
'.git/**', | ||
'.vercel/**', | ||
'**/node_modules/**', | ||
'**/.next/**', | ||
'**/.nuxt/**', | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tom, I was reviewing this PR, and I noticed the ignore rules are directly defined in the code. I was wondering if it might be worth considering an alternative approach by separating the default ignore rules into a constant, as shown below:
const DEFAULT_IGNORE_FOLDERS = [
'.git/**',
'.vercel/**',
'**/node_modules/**',
'**/.next/**',
'**/.nuxt/**',
];
........
ignore: config?.excludeFiles ?? DEFAULT_IGNORE_FOLDERS
This change could potentially improve the readability and maintainability of the code by clearly isolating the default rules, making them easier to manage and update if needed.
Of course, this is just a suggestion, and I'd love to hear your thoughts on whether this aligns with the team's preferences or goals for this functionality. Let me know if you think this would be helpful!
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @vercel/build-utils@9.0.0 ### Major Changes - Change getPathOverrideForPackageManager() to use detectedLockfile argument ([#12749](#12749)) ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) - add support for `images.qualities` ([#12792](#12792)) ## @vercel/edge@1.2.0 ### Minor Changes - moved methods to @vercel/functions ([#12758](#12758)) ## @vercel/python@4.6.0 ### Minor Changes - Update default ignored folders from the zip output: ([#12807](#12807)) - nested `node_modules` - nested `.next` & `.nuxt` - `.git` & `.vercel` ### Patch Changes - Support VERCEL_IPC_PATH along with VERCEL_IPC_FD ([#12800](#12800)) ## vercel@39.2.4 ### Patch Changes - Added root params support for pages powered by partial prerendering ([#12764](#12764)) - Update `@vercel/fun` to v1.1.2 ([#12791](#12791)) - Update "follow-redirects" to v1.15.9 to avoid security vulnerability report ([#12771](#12771)) - [deploy] make deploy --target case sensitive ([#12747](#12747)) - add support for `images.qualities` ([#12792](#12792)) - Updated dependencies \[[`79a7374cdd8e734f01ee1b9ad6662182b9090bc0`](79a7374), [`6150fbe18ef7fb4a6591a87a40c4452b2c9923ce`](6150fbe), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`c11c3553f30bf00501f7136cfb5fda9f9c4b4fb1`](c11c355), [`99a2899b9f3e1868752690f75bd1ca587f53ffdd`](99a2899), [`c31d0813fc9668859c81ec0002e502aa200eec95`](c31d081)]: - @vercel/next@4.4.1 - @vercel/static-build@2.5.40 - @vercel/build-utils@9.0.0 - @vercel/hydrogen@1.0.10 - @vercel/redwood@2.1.11 - @vercel/remix-builder@5.0.1 - @vercel/python@4.6.0 - @vercel/node@5.0.1 ## @vercel/client@13.5.3 ### Patch Changes - Updated dependencies \[[`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`c31d0813fc9668859c81ec0002e502aa200eec95`](c31d081)]: - @vercel/build-utils@9.0.0 ## @vercel/firewall@0.1.5 ### Patch Changes - remove "next" in firewall to resolve vulnerability report ([#12688](#12688)) ## @vercel/fs-detectors@5.3.2 ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) ## @vercel/gatsby-plugin-vercel-builder@2.0.62 ### Patch Changes - Updated dependencies \[[`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`c31d0813fc9668859c81ec0002e502aa200eec95`](c31d081)]: - @vercel/build-utils@9.0.0 ## @vercel/hydrogen@1.0.10 ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) ## @vercel/next@4.4.1 ### Patch Changes - Added root params support for pages powered by partial prerendering ([#12764](#12764)) - Fix next data route replacing ([#12782](#12782)) - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) - add support for `images.qualities` ([#12792](#12792)) ## @vercel/node@5.0.1 ### Patch Changes - Updated dependencies \[[`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`c31d0813fc9668859c81ec0002e502aa200eec95`](c31d081)]: - @vercel/build-utils@9.0.0 ## @vercel/redwood@2.1.11 ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) ## @vercel/remix-builder@5.0.1 ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) ## @vercel/static-build@2.5.40 ### Patch Changes - Refactor build-util usage to reuse detected lockfile ([#12749](#12749)) - Updated dependencies \[]: - @vercel/gatsby-plugin-vercel-builder@2.0.62 ## @vercel-internals/types@3.0.3 ### Patch Changes - Updated dependencies \[[`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`7adf5367054bdd86e7ecb9791290fffeb756fcfb`](7adf536), [`c31d0813fc9668859c81ec0002e502aa200eec95`](c31d081)]: - @vercel/build-utils@9.0.0
By default, the Python builder only ignores the root
node_modules
from the zip output. Many customers have Next.js or Nuxt.js apps along with their Python Vercel Functions, where nestednode_modules
folders and potentially.next
/.nuxt
build output folders could also be included in the zip, increasing its size for nothing.An example of that is our recent AI SDK Python Streaming template, where we had to ignore the
.next
manually because it was blowing up the size of the Python function: https://github.com/vercel-labs/ai-sdk-preview-python-streaming/blob/07a632d6fb60c2c09e725fc3d5be1c2a353855bd/vercel.json#L4This PR updates the default ignore list to ignore:
node_modules
.next
&.nuxt
folders.git
&.vercel