Skip to content

NaoyaMiyagawa/cakephp4-vite

Repository files navigation

CakePHP4 MPA integrated Vite

This is a sample app to implement Vite-integrated MPA (Multiple-Page Application) with CakePHP4.
With this app, you can use these tech stacks.

More detailed is here:
CakePHPのMPAにViteを導入して開発を加速させる⚡️ - Fusic Tech Blog

Installation

# Install php dependencies
composer install
# Install node dependencies
pnpm i

Dev

# Run CakePHP build-in webserver
bin/cake server -p 8765

# Run vite server
pnpm dev

Visit http://localhost:8765

Prod

CakePHP env file needs to be DEBUG="false". Modify config/.env first.

# Rerun CakePHP build-in webserver
bin/cake server -p 8765

# Run vite server
pnpm build