-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation about Laravel + Vite
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ... | ||
}); | ||
``` |