From 8b83f44a46ab49c295867e1566f07a877db0c17d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 10 Jul 2024 06:56:56 -0700 Subject: [PATCH] Tidy up esbuild bundle configs --- bin/esbuild.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/esbuild.mjs b/bin/esbuild.mjs index 65ebc124..aa86aa1b 100644 --- a/bin/esbuild.mjs +++ b/bin/esbuild.mjs @@ -20,23 +20,22 @@ const config = { /** @type {esbuild.BuildOptions} */ const commonOptions = { + bundle: true, format: 'esm', target: 'es2021', sourcemap: true, + treeShaking: true, logLevel: 'debug', }; /** @type {esbuild.BuildOptions} */ const devOptions = { minify: false, - treeShaking: true, }; /** @type {esbuild.BuildOptions} */ const prodOptions = { minify: true, - treeShaking: true, - logLevel: 'debug', legalComments: 'none', // TODO: Mangling private and protected properties will reduce bundle size quite a bit, we must // make sure we don't cast privates to `any` in order to prevent regressions. @@ -81,7 +80,6 @@ function getAddonEntryPoint(addon) { /** @type {esbuild.BuildOptions} */ let bundleConfig = { - bundle: true, ...commonOptions, ...(config.isProd ? prodOptions : devOptions) };