Vite reloads control panel #11495
Replies: 2 comments 3 replies
-
I've created a demo repo set up with the approach detailed here which works as described: https://github.com/jacksleight/statamic-vite-split-test When running |
Beta Was this translation helpful? Give feedback.
-
Thanks Jack, managed to get this working. Thanks so much for whipping up that test repo. It's all working now, just wondering, how does Statamic 'know' to look in I can see there's a Trying to understand how this works...
I can't see what part of this alternative set up stops the control panel from reloading? In my original set up, I had these files in my laravel input in my vite.config, they where also referenced in
Is that the bit that was making the control panel refresh? Because the control panel was using That must be it. Sorry for the ramble! And thanks again for your help :) |
Beta Was this translation helpful? Give feedback.
-
Is there a way to restrict vite, so it only reloads front-end pages?
I've found this post (11357), and the suggested solution is to have two vite configs.
I followed the instructions provided, but the same issue persists.
I've checked the
laravel-vite-plugin
docs, the default forrefresh: true,
means vite is triggered when any of these files are saved:The docs show it's possible to provide our own paths like this:
But this doesn't seem to restrict/exclude the pages vite refreshes, as any open tabs with
/cp
in the URL are also refreshed.Vite is also triggered when I save pages that outside of the scope specified?
The video below shows
refresh: ["resources/views/**"],
is set. However, when savingroutes/web.php
andlang/en/validation.php
both files are outsideresources/views/**
vite still reloads?vite-1.mp4
Beta Was this translation helpful? Give feedback.
All reactions