Skip to content

Commit 02bf9f2

Browse files
committed
refactor(@angular-devkit/build-angular): remove unneeded static block workaround
esbuild 0.18.2 contains a fix that removes the need for the workaround of disabling support for static class blocks. Related issue: evanw/esbuild#2950
1 parent aa0370a commit 02bf9f2

File tree

1 file changed

+0
-10
lines changed
  • packages/angular_devkit/build_angular/src/tools/esbuild

1 file changed

+0
-10
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/utils.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,6 @@ export function getFeatureSupport(target: string[]): BuildOptions['supported'] {
133133
// will be used instead which provides a workaround for the performance issue.
134134
// For more details: https://bugs.chromium.org/p/v8/issues/detail?id=11536
135135
'object-rest-spread': false,
136-
// esbuild currently has a defect involving self-referencing a class within a static code block or
137-
// static field initializer. This is not an issue for projects that use the default browserslist as these
138-
// elements are an ES2022 feature which is not support by all browsers in the default list. However, if a
139-
// custom browserslist is used that only has newer browsers than the static code elements may be present.
140-
// This issue is compounded by the default usage of the tsconfig `"useDefineForClassFields": false` option
141-
// present in generated CLI projects which causes static code blocks to be used instead of static fields.
142-
// esbuild currently unconditionally downlevels all static fields in top-level classes so to workaround the
143-
// Angular issue only static code blocks are disabled here.
144-
// For more details: https://github.com/evanw/esbuild/issues/2950
145-
'class-static-blocks': false,
146136
};
147137

148138
// Detect Safari browser versions that have a class field behavior bug

0 commit comments

Comments
 (0)