Skip to content

Commit 3ec651d

Browse files
committed
refactor(@angular-devkit/build-angular): remove __zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION` code
This is now done by default in zone.js versions greater than `0.14.1` (cherry picked from commit 7ffc46c)
1 parent eafadf7 commit 3ec651d

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/application-code-bundle.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,10 @@ export function createServerPolyfillBundleOptions(
252252
sourceFileCache?: SourceFileCache,
253253
): BundlerOptionsFactory | undefined {
254254
const polyfills: string[] = [];
255-
const zoneFlagsNamespace = 'angular:zone-flags/placeholder';
256255
const polyfillsFromConfig = new Set(options.polyfills);
257-
let hasZoneJs = false;
258256

259257
if (polyfillsFromConfig.has('zone.js')) {
260-
hasZoneJs = true;
261-
polyfills.push(zoneFlagsNamespace, 'zone.js/node');
258+
polyfills.push('zone.js/node');
262259
}
263260

264261
if (
@@ -311,22 +308,6 @@ export function createServerPolyfillBundleOptions(
311308
};
312309

313310
buildOptions.plugins ??= [];
314-
315-
// Disable Zone.js uncaught promise rejections to provide cleaner stacktraces.
316-
if (hasZoneJs) {
317-
buildOptions.plugins.unshift(
318-
createVirtualModulePlugin({
319-
namespace: zoneFlagsNamespace,
320-
entryPointOnly: false,
321-
loadContent: () => ({
322-
contents: `globalThis.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;`,
323-
loader: 'js',
324-
resolveDir: workspaceRoot,
325-
}),
326-
}),
327-
);
328-
}
329-
330311
buildOptions.plugins.push(createRxjsEsmResolutionPlugin());
331312

332313
return () => buildOptions;

0 commit comments

Comments
 (0)