Skip to content

Commit 8eb224a

Browse files
thomasballingerConvex, Inc.
authored andcommitted
Minify bundled code (#38230)
Minifying code should make bundles a bit smaller but should display the same (it's all sourcemapped). GitOrigin-RevId: c1dcb03efdf4ade526764f800f2ccb9ec2f24c84
1 parent b92129d commit 8eb224a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bundler/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ async function doEsbuild(
9191
splitting: true,
9292
chunkNames: path.join(chunksFolder, "[hash]"),
9393
treeShaking: true,
94-
minify: false,
94+
minifySyntax: true,
95+
minifyIdentifiers: true,
96+
// Enabling minifyWhitespace breaks sourcemaps on convex backends.
97+
// The sourcemaps produced are valid on https://evanw.github.io/source-map-visualization
98+
// but something we're doing (perhaps involving https://github.com/getsentry/rust-sourcemap)
99+
// makes everything map to the same line.
100+
minifyWhitespace: false, // false is the default, just showing for clarify.
95101
keepNames: true,
96102
define: {
97103
"process.env.NODE_ENV": '"production"',

0 commit comments

Comments
 (0)