https://github.com/mandrasch/ddev-vite-simple-demo
Simple demo for blog article on ddev.com
https://github.com/mandrasch/ddev-vite-simple-demo
ddev docker vite
Last synced: 4 months ago
JSON representation
Simple demo for blog article on ddev.com
- Host: GitHub
- URL: https://github.com/mandrasch/ddev-vite-simple-demo
- Owner: mandrasch
- License: cc0-1.0
- Created: 2023-11-04T17:32:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-04T15:27:47.000Z (over 1 year ago)
- Last Synced: 2025-02-04T16:28:02.350Z (over 1 year ago)
- Topics: ddev, docker, vite
- Language: JavaScript
- Homepage: https://ddev.com/blog/working-with-vite-in-ddev/
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ddev-vite-simple-demo
Simple Vite demo for blog article https://ddev.com/blog/working-with-vite-in-ddev/
## Local setup
```bash
ddev start
# install dependencies
ddev npm install
# start Vite dev server
ddev npm run dev
```
Then open https://test-vite.ddev.site/ in your browser (Or you can use `ddev launch` in another terminal)
(Second site for additional hostname: https://test-vite-second-page.ddev.site/)
## Troubleshooting
Vite dev server won't work with http://. HTTPS/SSL certificates must be properly setup beforehand and work on your laptop with DDEV. Check `ddev describe` and see DDEV installation docs regarding mkcert (https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/).
Run `ddev exec 'echo $DDEV_PRIMARY_URL'` => the output must be `https://test-vite.ddev.site` - not http://.
## Testing
- custom router port for https: `ddev config --router-https-port 8443`
- additional hostnames
- custom project_tld (not supported by this demo, change regex manually or see article)