Skip to content

Commit c826011

Browse files
committed
Add documentation about Laravel + Vite
1 parent 37078b5 commit c826011

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## UNRELEASED
4+
* Add documentation about running vite in Warden for Laravel ([wardenenv/warden#846](https://github.com/wardenenv/warden/issues/846) by @bap14)
5+
36
## Version [0.14.1](https://github.com/wardenenv/warden/tree/0.14.1) (2023-07-10)
47
[All Commits](https://github.com/wardenenv/warden/compoare/0.14.0..0.14.1)
58

environments/laravel.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Warden Laravel Environment
2+
3+
## Laravel + Vite
4+
5+
Starting with Laravel 9.x Vite was added as an asset bundler. Starting with Warden
6+
0.15.1 you can run the vite development server within the Warden container.
7+
8+
To fully support running the vite development server within the Warden container
9+
you need to adjust your `vite.config.js` file:
10+
11+
```javascript
12+
export default defineConfig({
13+
server: {
14+
host: true, // Tell's Vite to listen on all IP addresses; could also use '0.0.0.0'
15+
port: 5173,
16+
strictPort: true, // Don't let Vite choose a different port
17+
origin: `https://vite.<Warden Env Name>.test`, // Replace <Warden Env Name> with your Warden environment name
18+
allowedHosts: ['.<Warden Env Name>.test'], // Replace <Warden Env Name> with your Warden environment name
19+
cors: {
20+
origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(.+\.test)(?::\d+)?$/, // Allow any `.test` domain
21+
}
22+
},
23+
// ... The rest of your existing configuration ...
24+
});
25+
```

0 commit comments

Comments
 (0)