I’m working on a Laravel 11 project with Vite for asset bundling. Everything seems to work fine (HMR works and the assets are compiling), except for the fact that Vite is placing the manifest.json file inside a .vite directory (e.g., resources/build/.vite/manifest.json) instead of the expected public/build/manifest.json.
I’m getting the following error on my production server: production.ERROR: Vite manifest not found at: /home/forge/xxxxxxxx/public/build/manifest.json
I checked my vite.config.js, and my outDir is explicitly set to public/build, and I’ve enabled the manifest option. I also cleared Vite’s cache and double-checked any custom plugins that could be influencing this. However, the .vite folder keeps getting created, and Vite outputs the manifest.json inside it.
my vite.config.js details
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/css/tables.css',
'resources/js/app.js',
'resources/js/customreactcomponent/index.tsx',
],
refresh: true,
}),
react(),
],
build: {
outDir: 'public/build/',
manifest: true,
rollupOptions: {
input: {
app: 'resources/js/app.js',
'23andme-upload': 'resources/js/customreactcomponent/index.tsx'
},
},
},
});
relevent package.json details
"scripts": {
"dev": "vite",
"build": "vite build",
},
"devDependencies": {
"laravel-vite-plugin": "^1.0.5",
"vite": "^5.4.1"
}
When I run it locally, I get Vite manifest not found at: I:serverpublic./manifest.json
, which further confounds the issue. Are there any additional configuration settings I’m missing that might be working? HMR appears to be working fine, I just can’t get the build option to place the manifest in the expected place.