Skip to content

Commit

Permalink
docs: update gitpod and codespaces for working with vite (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandrasch committed May 30, 2024
1 parent 299f008 commit c415fce
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/content/blog/working-with-vite-in-ddev.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,23 +505,27 @@ Example repository for idleberg/php-wordpress-vite-assets, quick & dirty:

- [mandrasch/ddev-wp-vite-demo](https://github.com/mandrasch/ddev-wp-vite-demo)

#### GitHub Codespaces
#### Gitpod

I experimented with Gitpod support for Vite in these demo projects, see:

- [mandrasch/ddev-laravel-vite](https://github.com/mandrasch/ddev-laravel-vite)
- [mandrasch/ddev-craftcms-vite](https://github.com/mandrasch/ddev-craftcms-vite)

Another special case is GitHub Codespaces. This is a bit tricky because DDEVs router will not be used in Codespace environments.
Note: On Gitpod, DDEVs router is not used - therefore some adjustments are needed. Exposing the port does not work via `.ddev/config.yaml`, instead you can use a docker-compose-file. See `docker-compose.vite-workaround.yaml` in the demo repositories.

Therefore some adjustments are needed.
See [DDEV Installation: Gitpod](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#gitpod) for more information.

I created a first quick & dirty demo with CraftCMS, in which I use another port (5174) for Vite when Codespaces is detected:
#### GitHub Codespaces

- [Setup in Codespaces](https://github.com/mandrasch/ddev-craftcms-vite/tree/main#1-setup-in-codespaces)
- [config/vite.php](https://github.com/mandrasch/ddev-craftcms-vite/blob/main/config/vite.php)
- [vite.config.js](https://github.com/mandrasch/ddev-craftcms-vite/blob/main/vite.config.js)
I experimented with Codespaces support for Vite in these demo projects, see:

I guess this could be improved a lot ;-) See [DDEV Installation: Codespaces](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#github-codespaces) for more information.
- [mandrasch/ddev-laravel-vite](https://github.com/mandrasch/ddev-laravel-vite)
- [mandrasch/ddev-craftcms-vite](https://github.com/mandrasch/ddev-craftcms-vite)

#### Gitpod
Note: On Codespaces, DDEVs router is not used - therefore some adjustments are needed. Exposing the port does not work via `.ddev/config.yaml`, instead you can use a docker-compose-file. See `docker-compose.vite-workaround.yaml` in the demo repositories.

I couldn't find a resource where Vite was used with DDEV in Gitpod. Happy to update this section as well with more resources!
See [DDEV Installation: Codespaces](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#github-codespaces) for more information.

### NodeJS

Expand Down

0 comments on commit c415fce

Please sign in to comment.