question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to omit paths from refresh

See original GitHub issue

It’s super straightforward to include paths to look at for triggering a refresh, but it would be really helpful to be able to also define paths to exclude. The use case for me is that I’d like to omit resources/views/livewire/** and instead let the vite-livewire-plugin handle hot-reloading when those files change.

I was able to cobble together something that works based on the old workaround to get full page refresh working when blade files change by explicitly ensuring the triggering file(s) don’t include /livewire/ in their path name.

But it would be much nicer to, instead of this:

{
  name: 'blade',
  handleHotUpdate({ file, server }) {
    if ((file.includes('routes/') || file.endsWith('.blade.php')) && !file.includes('/livewire/')) {
      server.ws.send({
        type: 'full-reload',
        path: '*',
      })
    }
  },
}

Simply be able to do something like this:

{
  laravel({
    // ...
    refresh: ['resources/views/**'],
    omit: ['resources/views/livewire/**'],
  }),
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
timacdonaldcommented, Jul 19, 2022

@willvincent you can create a glob pattern to match your requirements. Under the hood, picomatch is used, so the following should work for your needs…

{
  laravel({
    // ...
    refresh: ['resources/views/!(livewire)**'],
  }),
}

You can learn more in the picomatch documentation: https://github.com/micromatch/picomatch#advanced-globbing

1reaction
willvincentcommented, Jul 20, 2022

Just downgraded to vite 2.9 and it’s all good!

🎉🤘

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exclude from refresh certain files for a folder data source
In Power BI desktop, we can enable/disable a query to be refreshed when clicking on the Refresh button in the top ribbon in...
Read more >
Forcing a React-Router <Link> to load a page, even if we're ...
Just adding a state does yield a new location , but now we can't "reload" the same path + state anymore without changing...
Read more >
Power BI - Disable Refresh of Local and Unsupported Data ...
Hey guys! Parker here. In this Power BI tutorial, I'm going to demonstrate how to hard code your data that doesn't need to...
Read more >
Disable refresh in Power Bi for local sources and more
You have asked me if it is possible to disable refresh on local sources and the answer is yes in the Power BI...
Read more >
?refresh | Elasticsearch Guide [8.5] | Elastic
The simplest and fastest choice is to omit the refresh parameter from the URL. If you absolutely must have the changes made by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found