Inertia.js + Laravel: Reproducible Development Environment?
0 reputation · 11 Apr 2025, 20:11 UTC
Goal
Build a development environment that reliably reproduces the same build artifacts and runtime behavior for an Inertia.js application built on Laravel. The aim is to avoid “works on my machine” discrepancies when developers clone the repo, install dependencies, and run the application.
Constraints & Uncertainty
Current setups vary: some teams use Docker, others rely on native PHP and Node installations. The Inertia client (React/Vue/Svelte) is bundled with Webpack or Vite, while the Laravel back‑end runs on PHP 8.x. The exact versions of Node, npm/yarn, and PHP are not consistently pinned across the repo, leading to subtle differences in asset compilation, caching, and API responses.
Questions
- Which version‑locking strategy (e.g., package.json
engines,composer.lock, DockerfileARG) best ensures that the Inertia client and Laravel server build the same assets on every machine? - How can we integrate the Inertia build step into the Laravel deployment pipeline so that the compiled assets are always regenerated under the same environment conditions?
- What testing or verification steps can be added to the CI workflow to catch mismatches between client‑side and server‑side builds before they reach production?