A tool for automatically generating Typescript Enums (that don't suck) from your PHP Enums.
Install the vite-plugin-watch
plugin in your project via npm
:
npm i -D vite-plugin-watch
In your vite.config.js
file, import the plugin, and add the plugin paramaters to your plugins array:
import { watch } from "vite-plugin-watch"
export default defineConfig({
plugins: [
// ...
watch({
pattern: "app/Enums/**/*.php",
command: "php artisan paragon:generate-enums",
}),
],
})