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 @@ -21,7 +21,15 @@ const UNSUPPORTED_OPTIONS: Array<keyof BrowserBuilderOptions> = [
'webWorkerTsConfig',
];

export function logBuilderStatusWarnings(options: BrowserBuilderOptions, context: BuilderContext) {
export function logBuilderStatusWarnings(
options: BrowserBuilderOptions,
{ logger }: BuilderContext,
) {
logger.warn(
`The 'browser-esbuild' builder is a compatibility builder which will be removed in a future major ` +
`version in favor of the 'application' builder.`,
);

// Validate supported options
for (const unsupportedOption of UNSUPPORTED_OPTIONS) {
const value = (options as unknown as BrowserBuilderOptions)[unsupportedOption];
Expand All @@ -41,12 +49,12 @@ export function logBuilderStatusWarnings(options: BrowserBuilderOptions, context
unsupportedOption === 'resourcesOutputPath' ||
unsupportedOption === 'deployUrl'
) {
context.logger.warn(
logger.warn(
`The '${unsupportedOption}' option is not used by this builder and will be ignored.`,
);
continue;
}

context.logger.warn(`The '${unsupportedOption}' option is not yet supported by this builder.`);
logger.warn(`The '${unsupportedOption}' option is not yet supported by this builder.`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { createAngularLocaleDataPlugin } from '../../tools/vite/i18n-locale-plug
import { RenderOptions, renderPage } from '../../utils/server-rendering/render-page';
import { getSupportedBrowsers } from '../../utils/supported-browsers';
import { getIndexOutputFile } from '../../utils/webpack-browser-config';
import { buildApplicationInternal } from '../application';
import { buildEsbuildBrowser } from '../browser-esbuild';
import { Schema as BrowserBuilderOptions } from '../browser-esbuild/schema';
import { loadProxyConfiguration } from './load-proxy-config';
Expand Down Expand Up @@ -116,9 +117,15 @@ export async function* serveWithVite(
let listeningAddress: AddressInfo | undefined;
const generatedFiles = new Map<string, OutputFileRecord>();
const assetFiles = new Map<string, string>();
const build =
builderName === '@angular-devkit/build-angular:application'
? buildApplicationInternal
: buildEsbuildBrowser;

// TODO: Switch this to an architect schedule call when infrastructure settings are supported
for await (const result of buildEsbuildBrowser(
browserOptions,
for await (const result of build(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
browserOptions as any,
context,
{
write: false,
Expand Down