laravel-workersv0.4.10
documentation

docs / Frontend & assets

Frontend & assets

The backend is compiled; the frontend is built — by your own toolchain, during the same build, and served from the same origin.

Two halves, decided before anything ships

Before compiling, the build scans resources/views/** for @vite ormix(). That decides whether your app needs a frontend build at all:

your appneeds public/build?what the build does
fullstackyes — a stock laravel new qualifiesruns your package.json build script (Bun first, npm as the automatic fallback), then verifies public/build/manifest.json
backend-onlyno — nothing reads itlogs backend-only (no frontend build needed) and proceeds
build stepsshell
# what the build runs for a fullstack app, in your app directory
bun install            # only when node_modules is absent
bun run build          # your package.json "build"
# falls back to npm install / npm run build when bun is missing or fails

The decision happens up front, not after shipping <script src> tags that point at files nobody built. When there is nothing it can run — no package.json, no build script, neither Bun nor npm on PATH, or the build itself fails — it stops with the view and the command that failed, named.

One origin

The result (public/build) is copied to dist/public and served by Workers Static Assets, from the same origin as the worker. There is no second port in production; the artisan serve + Vite pair exists only undercomposer run dev. Asset requests are static: they never invoke the worker.

What touches the network

Dependencies are installed only when node_modules is absent, so an existing tree is never modified. That install is the only network step in the frontend path; the compiler itself needs no network once the vendor tree exists.

Why Vite stays Vite

The toolchain compiles the backend and leaves the frontend to the tool you already chose. Vite produces the manifest; the compiled views read it at runtime exactly as Laravel's@vite directive would. No bundler plugin, no second config file, no rewrite of your assets.

Source: README.md §Fullstack app vs backend-only API — repository ba1e9a5