CLI
bash
inertia-typegen --config vite.config.tsThe CLI exports each document with php artisan scramble:export and writes the same files as the dev server. It needs no running server.
--config <file>: the Vite config with the plugin. Repeat the option for more configs.--check: compare the files with a fresh generation and exit with code 1 when they differ. Use it in CI or in a test.--out-dir <dir>: write to this folder instead.--php <command>: the PHP command. The default is thephpoption of the plugin, else Herd's PHP binary when Laravel Herd is inPATH, elsephp.
Commit the generated files. A production build then needs no PHP.