To develop Vike's documentation (https://vike.dev):
To develop Vike's source code:
1. Install
git clone git@github.com:vikejs/vike
cd vike/ # Go to the monorepo root
pnpm installNote
See System requirements for how to install pnpm.
2. Build
To build Vike's source code:
pnpm build # At the monorepo rootOr, if you want to watch & re-build upon modifications:
pnpm run dev # At the monorepo rootNote
When switching Git branches, you may need to run $ pnpm reset (at the monorepo root): it will re-install and re-build everything. It's required when switching to a branch that, for example, changes the dependencies list of package.json.
3. Try
To try your modifications, open a second shell and run:
cd examples/react-full/ # or another example
pnpm run devWarning
After changing the source code of Vike, make sure to always clear Vite's client cache with $ rm -rf examples/some-example/node_modules/.vite/. Otherwise you'll get a version mismatch between the server (using the latest build) and the client (using the previous cached build).
Run all
At the monorepo root:
# Run the unit tests /**/*.spec.js
pnpm exec vitest --project unit
# Run the end-to-end tests /**/*.test.js
pnpm exec test-e2eTip
The end-to-end tests can take a lot of time. We therefore recommend the following:
- Instead of running all end-to-end tests, run only the end-to-end tests of one example.
- Instead of running all end-to-end tests locally, run them on GitHub: push your changes to your Vike fork (
github.com/your-username/vike) and see the result of all end-to-end tests on the GitHub actions of your fork. On GitHub, the tests run in parallel and thus much faster than locally.
Note
On Debian, these additional steps are required.
Run subset
To run the end-to-end tests of only one example:
cd examples/some-example/ # From the monorepo root
pnpm exec test-e2eOr:
# Filter
pnpm exec test-e2e ome-exampl # At the monorepo rootTo develop Vike's documentation (https://vike.dev):
1. Install
git clone git@github.com:vikejs/vike
cd vike/ # Go to the monorepo root
pnpm installNote
See System requirements for how to install pnpm.
2. Build Vike
pnpm build # At the monorepo root3. Develop docs
cd docs/ # From the monorepo root
pnpm run dev- Node.js
>=20.0.0 - pnpm
Note
To install pnpm run:
npm install -g pnpm(Or see pnpm Docs > Installation for alternative methods.)
Note
These requirements are only needed for developing the source code of Vike. The npm package vike itself can be used with any package manager.