Skip to content

Instantly share code, notes, and snippets.

@rodrigopedra
Forked from lukeraymonddowning/ziggy-vite.js
Created July 4, 2022 14:24
Show Gist options
  • Save rodrigopedra/19867caf10e5eed14f301367829a24d8 to your computer and use it in GitHub Desktop.
Save rodrigopedra/19867caf10e5eed14f301367829a24d8 to your computer and use it in GitHub Desktop.
export default defineConfig({
plugins: [
laravel(['resources/js/app.js']),
{
name: 'ziggy',
enforce: 'post',
handleHotUpdate({ server, file }) {
if (file.includes('/routes/') && file.endsWith('.php')) {
exec('php artisan ziggy:generate', (error, stdout) => error === null && console.log(` > Ziggy routes generated!`))
}
}
}
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment