File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/angular/build/src/builders/application Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ import { inlineI18n, loadActiveTranslations } from './i18n';
3838import { NormalizedApplicationBuildOptions } from './options' ;
3939import { createComponentStyleBundler , setupBundlerContexts } from './setup-bundling' ;
4040
41+ /** The esbuild error text prefix used to detect top-level await errors. */
42+ const TOP_LEVEL_AWAIT_ERROR_TEXT =
43+ 'Top-level await is not available in the configured target environment' ;
44+
4145// eslint-disable-next-line max-lines-per-function
4246export async function executeBuild (
4347 options : NormalizedApplicationBuildOptions ,
@@ -162,11 +166,7 @@ export async function executeBuild(
162166 // the actual reason is that async/await is downleveled for Zone.js compatibility.
163167 if ( ! isZonelessApp ( options . polyfills ) ) {
164168 for ( const error of bundlingResult . errors ) {
165- if (
166- error . text ?. startsWith (
167- 'Top-level await is not available in the configured target environment' ,
168- )
169- ) {
169+ if ( error . text ?. startsWith ( TOP_LEVEL_AWAIT_ERROR_TEXT ) ) {
170170 error . notes = [
171171 {
172172 text :
You can’t perform that action at this time.
0 commit comments