Replies: 3 comments 3 replies
-
Agreed, the export default defineConfig({
server: {
watch: {
ignored: [
'**/vendor/**', '**/storage/**',
'!**/vendor/do/watch/this/one/**',
],
},
},
}) |
Beta Was this translation helpful? Give feedback.
-
I just had this problem in my development environment. I have a storage folder with lots of files inside, and Vite kept failing with the following error:
Adding storage and vendor folders to the list of ignored files fixed the problem. |
Beta Was this translation helpful? Give feedback.
-
I think the impact of this is being COMPLETELY overlooked. I spent the last 2 days tweaking configurations and even replacing tools in order to get to a minimal usable workflow. I was so frustrated that I even considered abandoning Vite for good. The Vite docs on this are misleading, since it states this:
The way directories are mentioned here, made me write the following config, which DIDN'T work: export default defineConfig({
server: {
watch: {
ignored: [
'vendor/', // <----- IT DOESN'T WORK
'storage/', // <----- IT DOESN'T WORK
],
},
},
}) You need to add the export default defineConfig({
server: {
watch: {
ignored: [
'**/vendor/**', // <----- WORKS PERFECTLY
'**/storage/**', // <----- WORKS PERFECTLY
],
},
},
}) So, I believe this is something that everyone using Vite with Laravel are certainly being affected by. Sometimes not even realizing it and just dealing with slow workflows. It seems like something that can certainly impact the framework adoption, since people coming from Nuxt, for instance, might notice the diference of performance and just assume that this is some particular weird interaction with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was having a problem with Vite being extremely slow, the problem was that Vite was watching my storage with thousands of files there,
took me some time to find the solution.
maybe we could have commented inside the vite.config.js on Laravel and laravel breeze, vite excluding vendor and storage?
by default it excludes, .git and node_modules,
export default defineConfig({ server: { watch: { ignored: ['**/vendor/**', '**/storage/**'] } }, });
Beta Was this translation helpful? Give feedback.
All reactions