The goal of this project is to provide a fully working "boilerplate" (empty skeleton project) using the CraftCMS project.
To start a CraftCMS project with this Boilerplate, simply:
Use the Composer create-project
command to install the boilerplate:
composer create-project --prefer-dist locomotivemtl/craft-boilerplate acme
Copy the .env.example.dev
file to .env
:
# Move into your project's directory
cd acme
# Setup valet to use PHP 8.2 only for this project
valet isolate --site acme 8.2
# Install the dependencies
valet composer install
# Run the valet installer.
valet php craft install
# Enable the Vite plugin
valet php craft plugin/install vite
WIP
Vite is a fast, modern build tool that speeds up development with instant hot reload and simplifies production bundling using native ES modules.
Add vite configurations to .env file
VITE_SERVER_URL="http://localhost"
VITE_SERVER_PORT=5173
# Make sure to set the environment to 'dev'. Otherwise, Craft won't be looking for the Vite server.
CRAFT_ENVIRONMENT=dev
npm install
Start your Vite server
npm run dev
Visit your project locally http://acme.test
PHP 8.2+
ext-json
ext-pdo
ext-spl
ext-mbstring