Skip to content
Merged
Show file tree
Hide file tree
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
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 ...
});
```