Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function createBrowserCodeBundleOptions(
entryNames: outputNames.bundles,
entryPoints,
target,
supported: getFeatureSupport(target, zoneless),
supported: getFeatureSupport(zoneless),
};

buildOptions.plugins ??= [];
Expand Down Expand Up @@ -278,7 +278,7 @@ export function createServerMainCodeBundleOptions(
js: `import './polyfills.server.mjs';`,
},
entryPoints,
supported: getFeatureSupport(target, zoneless),
supported: getFeatureSupport(zoneless),
};

buildOptions.plugins ??= [];
Expand Down Expand Up @@ -423,7 +423,7 @@ export function createSsrEntryCodeBundleOptions(
entryPoints: {
'server': ssrEntryNamespace,
},
supported: getFeatureSupport(target, true),
supported: getFeatureSupport(true),
};

buildOptions.plugins ??= [];
Expand Down
8 changes: 2 additions & 6 deletions packages/angular/build/src/tools/esbuild/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,12 @@ export async function withNoProgress<T>(text: string, action: () => T | Promise<
}

/**
* Generates a syntax feature object map for Angular applications based on a list of targets.
* Generates a syntax feature object map for Angular applications.
* A full set of feature names can be found here: https://esbuild.github.io/api/#supported
* @param target An array of browser/engine targets in the format accepted by the esbuild `target` option.
* @param nativeAsyncAwait Indicate whether to support native async/await.
* @returns An object that can be used with the esbuild build `supported` option.
*/
export function getFeatureSupport(
target: string[],
nativeAsyncAwait: boolean,
): BuildOptions['supported'] {
export function getFeatureSupport(nativeAsyncAwait: boolean): BuildOptions['supported'] {
Comment thread
alan-agius4 marked this conversation as resolved.
return {
// Native async/await is not supported with Zone.js. Disabling support here will cause
// esbuild to downlevel async/await, async generators, and for await...of to a Zone.js supported form.
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/build/src/tools/vite/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function getDepOptimizationConfig({
esbuildOptions: {
// Set esbuild supported targets.
target,
supported: getFeatureSupport(target, zoneless),
supported: getFeatureSupport(zoneless),
plugins,
loader,
define: {
Expand Down
Loading