Skip to content

Commit 0cac2c4

Browse files
authored
Callout --minify when script size is too large (#4201)
1 parent 1231a2b commit 0cac2c4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/bright-boxes-admire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Callout `--minify` when script size is too large

packages/wrangler/src/__tests__/deploy.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8011,7 +8011,7 @@ export default{
80118011
"err": "",
80128012
"info": "",
80138013
"out": "Total Upload: xx KiB / gzip: xx KiB",
8014-
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWe recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding past this can affect cold start time[0m
8014+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWe recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding this can affect cold start time. Consider using Wrangler's \`--minify\` option to reduce your bundle size.[0m
80158015
80168016
",
80178017
}

packages/wrangler/src/deployment-bundle/bundle-reporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function printBundleSize(
4343

4444
if (gzipSize > ALLOWED_INITIAL_MAX && !process.env.NO_SCRIPT_SIZE_WARNING) {
4545
logger.warn(
46-
"We recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding past this can affect cold start time"
46+
"We recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding this can affect cold start time. Consider using Wrangler's `--minify` option to reduce your bundle size."
4747
);
4848
}
4949
}

0 commit comments

Comments
 (0)