Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mindplay-dk/php-vite-mpa
https://github.com/mindplay-dk/php-vite-mpa
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mindplay-dk/php-vite-mpa
- Owner: mindplay-dk
- License: mit
- Created: 2024-04-22T11:32:35.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-10-08T10:55:54.000Z (3 months ago)
- Last Synced: 2024-10-13T13:09:02.569Z (3 months ago)
- Language: CSS
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP-Vite-MPA
Example MPA based on [`mindplay/vite`](https://github.com/mindplay-dk/php-vite).
**How does it work?**
* The `client` folder contains the client-side sources.
* The `public` folder is the public webroot.
* In production mode, Vite publishes compiled sources from `client` into `public/dist`.
* In development mode, Vite runs as a proxy server in front of PHP, enabling HMR.
* The `server` folder contains the `index.php` front-controller.
* In `index.php`, the `mindplay/vite` package is used to parse `manifest.json` and emit tags.
Have a look in `index.php` and `vite.config.ts` for more comments and explanations.
## Install
```bash
nvm use
composer install
```## Local Development
```bash
composer start
```⚠️ **NOTE:** Vite displays the wrong URL on startup - you must remove `/dist` from the URL after opening. (if you know how to fix this, please open an issue or PR in the [main repository](https://github.com/mindplay-dk/php-vite/issues).)
## Production Preview
```bash
composer preview
```## Production Build
```bash
composer build
```