@evomark/inertia-reprise
v1.0.1
Published
Inertia.js helpers for Symfony Reprise
Maintainers
Readme
@evomark/inertia-reprise
A Vite plugin bundling Symfony Reprise and the Inertia Vite plugin, with sensible defaults for client and SSR builds.
It is the recommended frontend setup for inertia-symfony. See its frontend setup guide in the documentation.
Usage
// vite.config.js
import { defineConfig } from "vite";
import inertiaReprise from "@evomark/inertia-reprise/vite";
export default defineConfig({
plugins: [inertiaReprise()],
});Peer dependencies: vite (8), @symfony/reprise, @inertiajs/vite.
Options
| Option | Description |
| --------- | --------------------------------------------------------------- |
| symfony | Options passed to the Symfony Reprise plugin. |
| inertia | Options passed to the Inertia Vite plugin. |
| input | Default entries. Defaults to { app: "assets/app.js" }. |
| ssr | SSR settings (below), or false to leave SSR builds untouched. |
An input configured in your own Vite config always wins over the defaults.
ssr
| Option | Default |
| --------------- | ------------------------------------------------------------------------- |
| input | { ssr: "assets/ssr.js" } if that file exists, otherwise input |
| outDir | var/ssr |
| entryFileName | ssr.js |
| noExternal | unset. Passed to Vite's ssr.noExternal; true bundles every dependency |
SSR builds skip the Symfony plugin, don't copy the public directory, empty the
output directory first and put shared chunks in chunks/.
Passing ssr: false leaves SSR builds untouched, runs the Symfony plugin for
them, and passes ssr: false to the Inertia plugin as well.
Running the SSR bundle
Build with vite build --ssr, then start it from the project root:
node var/ssr/ssr.jsBy default dependencies stay as runtime imports and are resolved from
node_modules. Set ssr: { noExternal: true } to produce a self-contained
bundle that can run without node_modules.
