So the hash in the css url is one thing in the manifest and another on disk?
Vite generating wrong URL for CSS asset
I'm running L9 and generating JS and CSS assets during deployment. My Vite config contains this:
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js'
],
refresh: true,
}),
My app template loads the generated assets with:
@vite(['resources/css/app.css', 'resources/js/app.js'])
and the build process generates a manifest.json like this:
{
"resources/js/app.js": {
"file": "assets/app.0fbda6ec.js",
"src": "resources/js/app.js",
"isEntry": true
},
"resources/css/app.css": {
"file": "assets/app.78f23fbd.css",
"src": "resources/css/app.css",
"isEntry": true
}
}
However, when my app loads, it refers to two URLs to load the JS and CSS assets. The JS one is correct, but the CSS one is not, so using the above manifest examples, I end up with URLs like:
build/assets/app.0fbda6ec.js
build/assets/app.1d3fb3db.css
You can see that the JS URL is correct, matching the one in the manifest, but the CSS one is not. If I re-run npm run build, the filenames remain unchanged. Given that these are both configured in a standard way, in the same place, with the same syntax, I'm mystified why this would be. What might be going astray?
Please or to participate in this conversation.