Files
Flash5/flash-extensions/flash-ext-web-bundler/docs/frontend-selection.md
T
Zakaria El OrcheandClaude Sonnet 5 8ece9975de feat(ext-web-bundler): add build-time asset scanning and static-frontend strategy
Introduces AssetDirectoryScanner, StaticFrontendStrategy, and WebBundlerBuild for
build-time asset discovery, plus config/docs updates for frontend-type resolution.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-11 00:22:26 +00:00

1.2 KiB

Frontend Selection

Frontend integration is explicit through frontendType.

  • No heuristic detection in v1.
  • Deterministic mapping: FrontendType -> FrontendStrategy.
  • Built-in strategies: VITE, STATIC.

VITE

Orchestrates a dev server process in DEV, serves a prebuilt directory in PROD. See dev-lifecycle.md.

STATIC

For files served as-is — no dev server, no package manager, no build step, no watch loop. STATIC never orchestrates, in DEV or PROD: it always loads assetsSource directly and serves it, the same code path VITE only uses in PROD. Editing a file during a running dev session requires a restart to be picked up (assets are preloaded once, same as VITE's prod serving — no hot reload).

Setting .frontendType(FrontendType.STATIC) also switches two other defaults (see configuration.md): operationMode becomes MANAGED and assetsSource defaults to the webRoot itself instead of a dist subdirectory — a minimal STATIC config is just:

WebBundlerConfig.builder()
    .frontendType(FrontendType.STATIC)
    .webRoot(Path.of("public"))
    .build()

Extension points:

  • register custom FrontendStrategy implementations in the resolver.
  • override default commands per config.