@vite and Manifest

The @vite Directive and the Build Manifest

npm 2,036 run build writes each entry point to public/build/assets under a content-hashed name, and public/build/manifest.json maps sources to outputs. @vite(['resources/css/app.css', 'resources/js/app.js']) in a layout looks each source up there; /shop, with no dev server:

Output of 61
$ npm run build
...
public/build/assets/app-Gs5LlxqT.css                           38.03 kB │ gzip: 9.47 kB
public/build/assets/app-BvRk9kiK.js                             0.00 kB │ gzip: 0.02 kB
✓ built in 1.40s
$ jq -c '."resources/css/app.css" | {file, src, isEntry}' public/build/manifest.json
{"file":"assets/app-Gs5LlxqT.css","src":"resources/css/app.css","isEntry":true}
$ curl -s http://127.0.0.1:8307/shop | grep -o '<[ls][^>]*build/assets/app[^>]*>' | fold -w 95
<link rel="preload" as="style" href="http://127.0.0.1:8307/build/assets/app-Gs5LlxqT.css" />
<link rel="modulepreload" as="script" href="http://127.0.0.1:8307/build/assets/app-BvRk9kiK.js"
 />
<link rel="stylesheet" href="http://127.0.0.1:8307/build/assets/app-Gs5LlxqT.css" />
<script type="module" src="http://127.0.0.1:8307/build/assets/app-BvRk9kiK.js">

The hash changes only with the content, so Apache can serve build/assets with a one-year immutable policy (mod_expires) and each deploy still busts the cache. Build in CI or on the server (.gitignore excludes public/build): with the build deleted, the page answered 500 and logged Vite 25,978 manifest not found at: .../public/build/manifest.json, the classic broken deploy.