Skip to content

Commit 00ef6f4

Browse files
authored
chore(build): drop minification from index bundler (#1215)
Removes the partial-minify branch (minifyWhitespace/minifyIdentifiers) in createIndexConfig so the index loader is produced unminified, matching the rest of the prod build config. Also drops the now-redundant `minify: false` from the package-builder templates that called it. Rationale: simpler, one shape of output, easier for contributors to read.
1 parent 2f052bf commit 00ef6f4

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

packages/cli/scripts/esbuild-utils.mts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ const logger = getDefaultLogger()
2020
* @param {Object} options - Configuration options
2121
* @param {string} options.entryPoint - Path to entry point file
2222
* @param {string} options.outfile - Path to output file
23-
* @param {boolean} [options.minify=false] - Whether to minify output
2423
* @returns {Object} esbuild configuration object
2524
*/
26-
export function createIndexConfig({ entryPoint, minify = false, outfile }: { entryPoint: string; minify?: boolean; outfile: string }) {
25+
export function createIndexConfig({ entryPoint, outfile }: { entryPoint: string; outfile: string }) {
2726
// Get inlined environment variables for build-time constant replacement.
2827
const inlinedEnvVars = getInlinedEnvVars()
2928

@@ -34,6 +33,7 @@ export function createIndexConfig({ entryPoint, minify = false, outfile }: { ent
3433
bundle: true,
3534
entryPoints: [entryPoint],
3635
format: 'cjs',
36+
minify: false,
3737
outfile,
3838
platform: 'node',
3939
// Source maps off for entry point production build.
@@ -50,13 +50,6 @@ export function createIndexConfig({ entryPoint, minify = false, outfile }: { ent
5050
write: false,
5151
}
5252

53-
if (minify) {
54-
config.minify = true
55-
} else {
56-
config.minifyWhitespace = true
57-
config.minifyIdentifiers = true
58-
}
59-
6053
return config
6154
}
6255

packages/package-builder/templates/cli-package/.config/esbuild.index.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const cliPath = path.resolve(__dirname, '../../cli')
1818
const config = createIndexConfig({
1919
entryPoint: path.join(cliPath, 'src', 'index.mts'),
2020
outfile: path.join(rootPath, 'dist', 'index.js'),
21-
minify: false,
2221
})
2322

2423
if (fileURLToPath(import.meta.url) === process.argv[1]) {

packages/package-builder/templates/cli-sentry-package/.config/esbuild.index.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const cliPath = path.resolve(__dirname, '../../cli')
1818
const config = createIndexConfig({
1919
entryPoint: path.join(cliPath, 'src', 'index.mts'),
2020
outfile: path.join(rootPath, 'dist', 'index.js'),
21-
minify: false,
2221
})
2322

2423
if (fileURLToPath(import.meta.url) === process.argv[1]) {

0 commit comments

Comments
 (0)