Commit 0f80bf3
perf: add Next.js config to exclude @xenova/transformers from server bundles
Following Vercel's best practices for Next.js projects:
- Added serverComponentsExternalPackages to mark AI/ML packages as external
- Configured outputFileTracingExcludes to prevent bundling transformer models
- Updated webpack config to explicitly externalize heavy packages on server
- Ensures @xenova/transformers only loads client-side in browser
Server bundle remains at 16KB (well under 250MB limit)
Client bundle optimized to 3.3KB initial load
References:
- https://nextjs.org/docs/app/api-reference/next-config-js/output
- https://vercel.com/guides/troubleshoot-serverless-function-size-limit
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent b72075f commit 0f80bf3
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
27 | 41 | | |
28 | 42 | | |
29 | 43 | | |
| |||
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
39 | 63 | | |
40 | 64 | | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
44 | 68 | | |
45 | 69 | | |
46 | | - | |
47 | | - | |
48 | 70 | | |
49 | 71 | | |
50 | 72 | | |
| |||
0 commit comments