diff --git a/devtools/projects/shell-browser/src/BUILD.bazel b/devtools/projects/shell-browser/src/BUILD.bazel index a52e84f78a8..b849e1f3fad 100644 --- a/devtools/projects/shell-browser/src/BUILD.bazel +++ b/devtools/projects/shell-browser/src/BUILD.bazel @@ -64,7 +64,12 @@ esbuild( minify = True, platform = "browser", splitting = False, - target = "esnext", + # todo(aleksanderbodurri): here we target es2020 explicitly. + # We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change + # to how angular static properties are attached to class constructors. + # Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class + # constructors to reference a class constructor variable that they do not have access to. + target = "es2020", deps = LINKER_PROCESSED_FW_PACKAGES + [":src"], ) @@ -76,7 +81,12 @@ esbuild( minify = True, platform = "browser", splitting = False, - target = "esnext", + # todo(aleksanderbodurri): here we target es2020 explicitly. + # We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change + # to how angular static properties are attached to class constructors. + # Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class + # constructors to reference a class constructor variable that they do not have access to. + target = "es2020", deps = [":devtools"], ) diff --git a/devtools/src/BUILD.bazel b/devtools/src/BUILD.bazel index bbeab0fdf7e..0501830cd43 100644 --- a/devtools/src/BUILD.bazel +++ b/devtools/src/BUILD.bazel @@ -45,7 +45,12 @@ esbuild( entry_points = [":main.ts"], platform = "browser", splitting = True, - target = "es2016", + # todo(aleksanderbodurri): here we target es2020 explicitly. + # We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change + # to how angular static properties are attached to class constructors. + # Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class + # constructors to reference a class constructor variable that they do not have access to. + target = "es2020", deps = LINKER_PROCESSED_FW_PACKAGES + [":demo"], )