mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-20 05:24:57 +08:00
refactor(@angular-devkit/build-angular): remove __zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PRO
MISE_REJECTION` code
This is now done by default in zone.js versions greater than `0.14.1`
This commit is contained in:
parent
6d8d948ad0
commit
7ffc46c70d
@ -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 (
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user