this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: minify the generated bundle by default (#714)

authored by

Victor Berchet and committed by
GitHub
eedbe2b7 3d8fb0c3

+11 -2
+5
.changeset/giant-books-dream.md
··· 1 + --- 2 + "@opennextjs/cloudflare": patch 3 + --- 4 + 5 + perf: minify the generated bundle by default
+6 -2
packages/cloudflare/src/cli/build/bundle-server.ts
··· 48 48 export async function bundleServer(buildOpts: BuildOptions): Promise<void> { 49 49 patches.copyPackageCliFiles(packageDistDir, buildOpts); 50 50 51 - const { appPath, outputDir, monorepoRoot } = buildOpts; 51 + const { appPath, outputDir, monorepoRoot, debug } = buildOpts; 52 52 const baseManifestPath = path.join( 53 53 outputDir, 54 54 "server-functions/default", ··· 76 76 outfile: openNextServerBundle, 77 77 format: "esm", 78 78 target: "esnext", 79 - minify: false, 79 + // Minify code as much as possible but stay safe by not renaming identifiers 80 + minifyWhitespace: !debug, 81 + minifyIdentifiers: false, 82 + minifySyntax: !debug, 83 + legalComments: "none", 80 84 metafile: true, 81 85 // Next traces files using the default conditions from `nft` (`node`, `require`, `import` and `default`) 82 86 //