-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
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*/**/*', |
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.
[dust] consider a separate PR for not bundling swc.
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
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
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.