Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vite.md #8024

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,24 @@ npm run build
node storage/ssr/ssr.js
```

### Customising Your SSR File Output Directory
It is common for server deployment solutions such as [Envoyer](https://envoyer.io/) to create a symlinked `/storage` directory. This will prevent the `ssr.js` file built with Vite from functioning properly. In this case you may wish to define a different output directory in your Vite config.

```js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.js',
ssr: 'resources/js/ssr.js',
ssrOutputDirectory: 'public/ssr', // [tl! add]
}),
],
});
```

This example overrides the default output path and outputs your built `ssr.js` file to `/public/ssr/ssr.js`.

> {tip} Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia SSR, and Vite configuration. Check out [Laravel Breeze](/docs/{{version}}/starter-kits#breeze-and-inertia) for the fastest way to get started with Laravel, Inertia SSR, and Vite.