[Angular] Move the serve target off deprecated @angular-devkit/build-angular (webpack) dev-server #1171

Open
opened 2026-10-02 04:44:19 +00:00 by spikerj · 0 comments
Owner

Why

npm now marks @angular-devkit/build-angular deprecated: "Angular's Webpack support is deprecated. Use the esbuild and Vite-based "@angular/build" package instead." Our build is already esbuild (@angular/build), but the package is still pulled in:

  1. serve uses @nx/angular:dev-server, which always imports executeDevServerBuilder from @angular-devkit/build-angular (node_modules/@nx/angular/dist/src/builders/dev-server/dev-server.impl.js ~L101-103) even for esbuild builds.
  2. Storybook — @storybook/angular 10.6 requires it as a peer (>=18 <23) and .storybook/main.ts uses webpackFinal, so Storybook genuinely runs on webpack.

What changes for us

  • Switch projects/spikersoft/project.json serve to @angular/build:dev-server. Catch: it does not pick up the build target's plugins option (node-builtins-browser-shim.plugin.cjs) the way the Nx executor does — verify the dev server still resolves the node-builtin shims (or move them to a supported mechanism).
  • Keep @angular-devkit/build-angular only for Storybook until Storybook Angular supports the Vite/esbuild builder; document that in package.json/pnpm-workspace.yaml comments, and drop the related pnpm overrides once nothing else needs them.

Acceptance criteria

  • nx serve spikersoft runs on @angular/build:dev-server with HMR, proxy and shims working
  • remaining build-angular usage is Storybook-only and commented

Size: M. See also the "options:" typo bug on the same serve target.

Links: Related: #1176 (same serve target).


Filed from the 2026-10-02 spikersoft-angular pnpm outdated changelog review.

## Why npm now marks `@angular-devkit/build-angular` **deprecated**: "Angular's Webpack support is deprecated. Use the esbuild and Vite-based "@angular/build" package instead." Our build is already esbuild (`@angular/build`), but the package is still pulled in: 1. **`serve`** uses `@nx/angular:dev-server`, which always imports `executeDevServerBuilder` from `@angular-devkit/build-angular` (`node_modules/@nx/angular/dist/src/builders/dev-server/dev-server.impl.js` ~L101-103) even for esbuild builds. 2. **Storybook** — `@storybook/angular` 10.6 requires it as a peer (`>=18 <23`) and `.storybook/main.ts` uses `webpackFinal`, so Storybook genuinely runs on webpack. ## What changes for us - Switch `projects/spikersoft/project.json` `serve` to `@angular/build:dev-server`. Catch: it does not pick up the build target's `plugins` option (`node-builtins-browser-shim.plugin.cjs`) the way the Nx executor does — verify the dev server still resolves the node-builtin shims (or move them to a supported mechanism). - Keep `@angular-devkit/build-angular` only for Storybook until Storybook Angular supports the Vite/esbuild builder; document that in `package.json`/`pnpm-workspace.yaml` comments, and drop the related pnpm overrides once nothing else needs them. ## Acceptance criteria - [ ] `nx serve spikersoft` runs on `@angular/build:dev-server` with HMR, proxy and shims working - [ ] remaining build-angular usage is Storybook-only and commented Size: **M**. See also the `"options:"` typo bug on the same `serve` target. **Links:** Related: #1176 (same serve target). --- _Filed from the 2026-10-02 spikersoft-angular `pnpm outdated` changelog review._
spikerj added the enhancement label 2026-10-02 04:44:19 +00:00
Sign in to join this conversation.