Skip to content

Commit c887f99

Browse files
committed
ref: Reduce bundle size for Vercel functions
1 parent c26ffdc commit c887f99

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

next.config.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,43 @@ import {redirects} from './redirects.js';
55

66
const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
77
? {
8-
'/**/*': ['./.git/**/*', './apps/**/*', 'docs/**/*'],
8+
'/**/*': [
9+
'**/*.map',
10+
'./.git/**/*',
11+
'./apps/**/*',
12+
'./next/cache/mdx-bundler/**/*',
13+
'./next/cache/md-exports/**/*',
14+
'docs/**/*',
15+
],
916
}
1017
: {
1118
'/**/*': [
19+
'**/*.map',
1220
'./.git/**/*',
21+
'./next/cache/mdx-bundler/**/*',
22+
'./next/cache/md-exports/**/*',
1323
'./apps/**/*',
1424
'develop-docs/**/*',
15-
'node_modules/@esbuild/darwin-arm64',
25+
'node_modules/@esbuild/*',
26+
],
27+
'/platform-redirect': [
28+
'**/*.gif',
29+
'public/mdx-images/**/*',
30+
'**/*.pdf',
31+
'docs/**/*',
1632
],
17-
'/platform-redirect': ['**/*.gif', 'public/mdx-images/**/*', '*.pdf'],
1833
'\\[\\[\\.\\.\\.path\\]\\]': [
1934
'docs/**/*',
2035
'node_modules/prettier/plugins',
2136
'node_modules/rollup/dist',
2237
],
23-
'sitemap.xml': ['docs/**/*', 'public/mdx-images/**/*', '*.gif', '*.pdf', '*.png'],
38+
'sitemap.xml': [
39+
'docs/**/*',
40+
'public/mdx-images/**/*',
41+
'**/*.gif',
42+
'**/*.pdf ',
43+
'**/*.png',
44+
],
2445
};
2546

2647
if (

scripts/generate-md-exports.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ async function processTaskList({id, tasks, cacheDir, noCache}) {
283283
const fileHash = md5(data);
284284
if (r2Hash !== fileHash) {
285285
r2CacheMisses.push(relativePath);
286-
console.log(
287-
`📤 Worker[${id}]: Uploading ${relativePath} to R2, hash mismatch: ${r2Hash} !== ${fileHash}`
288-
);
286+
289287
await uploadToCFR2(s3Client, relativePath, data);
290288
}
291289
}
@@ -296,7 +294,7 @@ async function processTaskList({id, tasks, cacheDir, noCache}) {
296294
const success = tasks.length - failedTasks.length;
297295
if (r2CacheMisses.length / tasks.length > 0.1) {
298296
console.warn(
299-
`⚠️ Worker[${id}]: More than 10% of files had a different hash on R2, this might indicate a problem with the cache or the generation process.`
297+
`⚠️ Worker[${id}]: More than 10% of files had a different hash on R2 with the generation process.`
300298
);
301299
} else if (r2CacheMisses.length > 0) {
302300
console.log(

0 commit comments

Comments
 (0)