Skip to content

docs(site): add serve options, scripts and per-file fixes to migrating from ng build - #171

Merged
ChristopherPHolder merged 1 commit into
mainfrom
docs/migration-gotchas
Dec 4, 2026
Merged

ChristopherPHolder merged 1 commit into
mainfrom
docs/migration-gotchas

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Closes #153

What changed

site/content/migrating-from-ng-build.md

  • Read in this order. This list replaces the old line 10, which sent readers to Getting started and back with no order. The order is: Can't move yet, then Getting started, then the rest of this page.
  • Moving ng serve. A row for every option in @angular/build:dev-server's schema: port, host, proxyConfig, ssl/sslKey/sslCert, headers, open, allowedHosts, define, servePath, hmr, liveReload, watch/poll, verbose, inspect, prebundle, buildTarget. Each row gives its Vite setting.
    • The proxy subsection lists the three things the CLI converts before handing the file to Vite: glob keys, the array form with context, and pathRewrite.
  • Scripts, index.html and tests. The package.json scripts, the CLI's src/index.html against Vite's root index.html (linking Getting started step 3), and the test target (linking Testing with Vitest).
  • What your sources may need. One subsection per fix, each with what you see, why and the fix, plus which app needed it. The evidence comes from bench/real/*.patch and the bench configs:
    • type-only re-exports: Super Productivity had 7 statements in 5 files, Ghostfolio 1
    • emitDecoratorMetadata
    • TypeScript transformers (typia)
    • TypeScript 7 being stricter: TS18046/TS2769 in Super Productivity, and TS5090
    • template errors ngc doesn't report: TS2774 in Ghostfolio, fixed with $any()

Other pages, line-local only

How I checked it

  • Vite settings: read from Vite 8.3.4's dist/node/index.d.ts in node_modules: CommonServerOptions, ServerOptions (hmr, ws, watch: … | null), ProxyOptions. I also read its proxy matcher (^ keys are regexes, other keys are prefixes), the effect of server.hmr: false on file changes, vite --help (--profile), and the default port, 5173.
  • ng serve options: read from the @angular/build@22.3.0 package: dev-server/schema.json, vite/server.js (basic-ssl when ssl is set without files, ws: false when both liveReload and hmr are off), and utils/load-proxy-config.js (glob, array and pathRewrite conversion).
  • Fixes: checked against bench/real/super-productivity.patch, bench/real/ghostfolio.patch, both vite.config.ngp.mjs files, bench-typia.mjs and isolated-modules-fix.mjs.
  • Docs check and site build: pnpm docs:check reports 19 pages and 472 links, all in step. pnpm site:build passes.
  • Visual check: I served site/dist/client statically under /vite-plugin-ngp/ on port 4333 and looked at the new sections at 1280 px in light mode and 390 px in dark mode. No horizontal page scroll; code blocks scroll inside their box, as the existing ones do.
  • I didn't run pnpm test, because sibling worktrees share its fixed ports. This PR changes docs only.

🤖 Generated with Claude Code

…g from ng build

Someone moving a plain CLI app read Getting started and Migrating from ng build,
and neither had the per-file fixes the Benchmarks apps needed, nor ng serve's
options, the scripts or the test target. Migrating now has a table for every
dev-server option checked against @angular/build 22.3.0's schema and Vite
8.3's types, the proxy file's differences, the scripts, index.html and tests,
and a section on type-only re-exports, decorator metadata, TypeScript
transformers, TypeScript 7 and template errors ngc doesn't report, each with
what you see, why and the fix, and the evidence from the bench's patches.

It says what to read in which order, Getting started's Next list starts with
it, and Nx and Benchmarks link the new section instead of repeating it.

Closes #153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChristopherPHolder
ChristopherPHolder merged commit 531dd3f into main Dec 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: put the per-file migration gotchas where people moving an app will read them

1 participant