Skip to content

fix: exclude swc by default, and don't exclude sharp if included #1745

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

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Nov 7, 2022

Summary

Currently we exclude several large node modules from being bundled with functions, to avoid going over the 50MB limit. Since Next 13, functions are trying to bundle swc binaries, which are massive. This PR excludes them. However, some users do want to bundle sharp, for example if they're using it in API call. This PR means it no longer excludes sharp if the user has manually added it to included_files

Test plan

  1. Run a local build of the demo site.
  2. Run zipinfo .netlify/functions/___netlify-odb-handler.zip | sort -nr -k 4 | head. Ensure that no files matching @next/swc* are included.

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

capy in severance

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6368dfb64ea86d00084c272f
😎 Deploy Preview https://deploy-preview-1745--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6368dfb61dc65c0009a8623c
😎 Deploy Preview https://deploy-preview-1745--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6368dfb6b077c300092579f2
😎 Deploy Preview https://deploy-preview-1745--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ascorbic ascorbic marked this pull request as ready for review November 7, 2022 10:36
@ascorbic ascorbic requested a review from a team November 7, 2022 10:36
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 7, 2022
@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6368dfb6d2a5f90009fe5334
😎 Deploy Preview https://deploy-preview-1745--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6368dfb611a65200094c36b2
😎 Deploy Preview https://deploy-preview-1745--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6368dfb63e4d9f00093baec8
😎 Deploy Preview https://deploy-preview-1745--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6368dfb6a779b90008cc2541
😎 Deploy Preview https://deploy-preview-1745--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6368dfb6ada7dc000845f035
😎 Deploy Preview https://deploy-preview-1745--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit e65186f
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6368dfb65dcb9d000999ed7e
😎 Deploy Preview https://deploy-preview-1745--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ascorbic! Letf one suggestion. 🚀

@@ -517,6 +518,7 @@ describe('onBuild()', () => {
'.next/BUILD_ID',
'.next/static/chunks/webpack-middleware*.js',
'!.next/server/**/*.js.nft.json',
'!**/node_modules/@next/swc*/**/*',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] consider a separate PR for not bundling swc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants