From bebed9df834d01f72753aa0e60dc104f1781bd67 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Wed, 26 Oct 2022 10:02:28 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): issue dev-server support warning when using esbuild builder The dev-server builder currently does not support the experimental esbuild-based browser application builder and will use the Webpack-based builder instead. To better inform users of this behavior, a warning is now issued upon executing the dev-server. (cherry picked from commit 0fcc603ae7945e5a4eb9afebce42597b33a8f7aa) --- .../build_angular/src/builders/dev-server/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts b/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts index cdcb41122498..cc22ffba223a 100644 --- a/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts +++ b/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts @@ -141,6 +141,16 @@ export function serveWebpackBrowser( const cacheOptions = normalizeCacheOptions(metadata, context.workspaceRoot); const browserName = await context.getBuilderNameForTarget(browserTarget); + + // Issue a warning that the dev-server does not currently support the experimental esbuild- + // based builder and will use Webpack. + if (browserName === '@angular-devkit/build-angular:browser-esbuild') { + logger.warn( + 'WARNING: The experimental esbuild-based builder is not currently supported ' + + 'by the dev-server. The stable Webpack-based builder will be used instead.', + ); + } + const browserOptions = (await context.validateOptions( { ...rawBrowserOptions,