Skip to content

Commit

Permalink
Add documentation about Laravel + Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
bap14 committed Mar 1, 2025
1 parent 37078b5 commit c826011
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## UNRELEASED
* Add documentation about running vite in Warden for Laravel ([wardenenv/warden#846](https://github.com/wardenenv/warden/issues/846) by @bap14)

## Version [0.14.1](https://github.com/wardenenv/warden/tree/0.14.1) (2023-07-10)
[All Commits](https://github.com/wardenenv/warden/compoare/0.14.0..0.14.1)

Expand Down
25 changes: 25 additions & 0 deletions environments/laravel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Warden Laravel Environment

## Laravel + Vite

Starting with Laravel 9.x Vite was added as an asset bundler. Starting with Warden
0.15.1 you can run the vite development server within the Warden container.

To fully support running the vite development server within the Warden container
you need to adjust your `vite.config.js` file:

```javascript
export default defineConfig({
server: {
host: true, // Tell's Vite to listen on all IP addresses; could also use '0.0.0.0'
port: 5173,
strictPort: true, // Don't let Vite choose a different port
origin: `https://vite.<Warden Env Name>.test`, // Replace <Warden Env Name> with your Warden environment name
allowedHosts: ['.<Warden Env Name>.test'], // Replace <Warden Env Name> with your Warden environment name
cors: {
origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(.+\.test)(?::\d+)?$/, // Allow any `.test` domain
}
},
// ... The rest of your existing configuration ...
});
```

0 comments on commit c826011

Please sign in to comment.