angular/angular-cli · warning

Prebundling has been configured but will not be used because

Error message

Prebundling has been configured but will not be used because it is not supported by the "${builderName}" builder.

What it means

Warning that esbuild prebundling (the 'prebundle' option, backed by Vite-style dependency prebundling) is enabled but the resolved underlying builder is Webpack-based, which does not support prebundling. The option is ignored and rebuild/startup speed benefits are lost.

Source

Thrown at packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts:126

              (options, context, codePlugins) => {
                return builderName === '@angular-devkit/build-angular:browser-esbuild'
                  ? // eslint-disable-next-line @typescript-eslint/no-explicit-any
                    buildApplicationInternal(convertBrowserOptions(options as any), context, {
                      codePlugins,
                    })
                  : buildApplicationInternal(options, context, { codePlugins });
              },
              context,
              transforms,
              extensions,
            ),
          ),
        );
      }

      // Warn if the initial options provided by the user enable prebundling with Webpack-based builders
      if (options.prebundle) {
        context.logger.warn(
          `Prebundling has been configured but will not be used because it is not supported by the "${builderName}" builder.`,
        );
      }

      if (extensions?.buildPlugins?.length) {
        throw new Error('Only the "application" and "browser-esbuild" builders support plugins.');
      }
      if (extensions?.middleware?.length) {
        throw new Error(
          'Only the "application" and "browser-esbuild" builders support middleware.',
        );
      }

      // Webpack based build systems default to false for hmr option
      normalizedOptions.hmr ??= false;

      // Use Webpack for all other browser targets
      return defer(() => import('./webpack-server')).pipe(

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Remove the `prebundle` option from the serve target.
  2. Migrate the application builder to '@angular/build:application' so prebundling is actually supported.
  3. Or keep the option only in configurations used by esbuild-based builders.

Example fix

// before
"options": { "prebundle": true }
// after (webpack-based serve)
"options": {}
Defensive patterns

Strategy: validation

Validate before calling

if (builderName.startsWith('@angular-devkit') && target.options?.prebundle) {
  console.warn('prebundle ignored: requires an esbuild-based application builder.');
}

Type guard

function enablesPrebundle(o: unknown): o is { prebundle: boolean } {
  return typeof o === 'object' && o !== null && (o as any).prebundle === true;
}

Prevention

When it happens

Trigger: Setting `prebundle: true` (or the default truthy value) on the dev-server target while builderName resolves to a Webpack builder (legacy 'browser' + 'dev-server' combo).

Common situations: Projects that enabled prebundle in a serve config shared between esbuild and Webpack targets; partial migrations where the app builder was swapped but the dev-server target options kept `prebundle`.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/0e649ff116019e92. Report an issue: GitHub.