Thanks for your interest in contributing to Inertia.js!
To make local Inertia.js development easier, this project has been setup as a monorepo using NPM Workspaces. To set it up, start by cloning the repository on your system.
git clone https://github.com/inertiajs/inertia.git inertia
cd inertia
Next, install the JavaScript dependencies:
npm install
Next, build the packages:
npm run build --workspace=packages --if-present
If you're making changes to one of the packages that requires a build step (core
, react
, vue2
, vue3
), you can setup a watcher to automatically run the build step whenever files are changed.
cd packages/core
npm run dev
When proposing changes to one of the adapters (react
, vue2
, vue3
, svelte
), please try to apply the same changes to the other adapters where possible.
It's often helpful to develop Inertia.js using a real application. The playground folder contains an example Laravel project for each of the adapters. Here's how to get a playground running:
cd playgrounds/react
npm run build
composer install
cp .env.example .env
php artisan key:generate
php artisan serve
# visit the site at http://127.0.0.1:8000
To automatically see changes to the JavaScript files in the browser, start the development server:
npm run dev
To test the SSR mode, first run the build, and then start the SSR server:
npm run build
npm run ssr:serve
This section is really for the benefit of the core maintainers.
- Increment the version numbers in the
package.json
file for each package, making sure to also update the adapter dependencies on@inertiajs/core
. - Run
npm install
to update the top-levelpackage-lock.json
file. - Update
CHANGELOG.md
. - Run
npm publish
for each package. This will automatically run the necessary build step. When publishing beta releases, make sure to runnpm publish --tag=beta
. - Add release notes to GitHub.