fix(portal-shell): use .postcssrc.json so tailwind utilities are emitted
CI / commits (pull_request) Successful in 1m25s
CI / check (pull_request) Successful in 1m35s
CI / scan (pull_request) Successful in 1m35s
CI / a11y (pull_request) Successful in 1m51s
CI / perf (pull_request) Successful in 3m51s

The portal-shell scaffold shipped a `postcss.config.js`, but
`@angular/build` (Angular 17+ esbuild pipeline) does not load that
file format — it only picks up `.postcssrc.json`. Result: the
`@tailwindcss/postcss` plugin was never registered, Tailwind ran
with no source files visible, generated only its `@theme` block,
and dropped every utility class on the floor. The page rendered
unstyled — black text on white — even though `nx build` reported
success and shipped a 23 KB styles.css.

Fix: rename / re-encode the config to `.postcssrc.json`. Same
plugin, same options, just the file format Angular's esbuild
adapter actually reads.

Verified locally:
- Before:  ZERO class selectors in dist/.../styles*.css.
- After:  75 selectors in production build, including the ones
  referenced from header/footer/home/accessibility templates
  (`.text-3xl`, `.bg-amber-50`, `.font-semibold`, etc.).

The repo-layout walkthrough in `docs/development.md` is updated to
reflect the new file name and explicitly call out the gotcha so a
future contributor doesn't reach for `postcss.config.js` again.
This commit is contained in:
Julien Gautier
2026-05-10 02:53:58 +02:00
parent 0d31937aeb
commit bb9654cc32
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ apf_portal/
│ ├── portal-shell/ # Angular 21 SPA (zoneless, standalone, Signals, Vitest, SCSS)
│ │ ├── public/ # static assets
│ │ ├── src/ # entry, app config, routes, styles
│ │ ├── postcss.config.js # Tailwind PostCSS plugin
│ │ ├── .postcssrc.json # Tailwind PostCSS plugin (required by @angular/build esbuild — postcss.config.js is ignored)
│ │ └── project.json # Nx project config (build, serve, test, lint targets)
│ ├── portal-shell-e2e/ # Playwright e2e for portal-shell
│ ├── portal-bff/ # NestJS 11 BFF (Express adapter, ValidationPipe, Jest)