Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(@angular-devkit/build-angular): remove __zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION code #26210

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -252,13 +252,10 @@ export function createServerPolyfillBundleOptions(
sourceFileCache?: SourceFileCache,
): BundlerOptionsFactory | undefined {
const polyfills: string[] = [];
const zoneFlagsNamespace = 'angular:zone-flags/placeholder';
const polyfillsFromConfig = new Set(options.polyfills);
let hasZoneJs = false;

if (polyfillsFromConfig.has('zone.js')) {
hasZoneJs = true;
polyfills.push(zoneFlagsNamespace, 'zone.js/node');
polyfills.push('zone.js/node');
}

if (
Expand Down Expand Up @@ -311,22 +308,6 @@ export function createServerPolyfillBundleOptions(
};

buildOptions.plugins ??= [];

// Disable Zone.js uncaught promise rejections to provide cleaner stacktraces.
if (hasZoneJs) {
buildOptions.plugins.unshift(
createVirtualModulePlugin({
namespace: zoneFlagsNamespace,
entryPointOnly: false,
loadContent: () => ({
contents: `globalThis.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;`,
loader: 'js',
resolveDir: workspaceRoot,
}),
}),
);
}

buildOptions.plugins.push(createRxjsEsmResolutionPlugin());

return () => buildOptions;
Expand Down