From 4b641a914b8c867a68c62bf79f90ae1e0d8b6906 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sat, 23 Oct 2021 17:47:21 +0200 Subject: [PATCH] build: enable code splitting for esbuild bundling of compiler-cli (#43932) Enables code spitting for ESBuild bundling of the compiler-cli. When we initially configured ESBuild as part of APF v13, we left this option disabled as code splitting is marked experimental. The ESM splitting mechanism in ESBuild seems very solid so far (judging subjectively and by experience/reports in the ESBuild repo), so we should give it a shot, in order to significantly reduce the size of the NPM package, and simplify debugging (by not having duplicated code portions for all the different entry points). To clarify: Code splitting is helpful as we have multiple entry-points that currently duplicate code. With code splitting these entry-points would share common code instead. PR Close #43932 --- packages/compiler-cli/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/compiler-cli/BUILD.bazel b/packages/compiler-cli/BUILD.bazel index 47b250741d1..6212b69a8bd 100644 --- a/packages/compiler-cli/BUILD.bazel +++ b/packages/compiler-cli/BUILD.bazel @@ -58,6 +58,7 @@ esbuild( ], format = "esm", platform = "node", + splitting = True, target = "node12", deps = PUBLIC_TARGETS, )