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
Build Vike's source code:
pnpm build # At the monorepo root3. Develop
Watch & re-build upon modifications:
pnpm dev # At the monorepo rootIn a second shell:
cd examples/some-example/ # or any other examples/*
pnpm devThat's it. You can now test your modifications.
Warning
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).
Note
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 at vike/package.json.
# 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-e2eRun the end-to-end tests of only one example:
cd examples/some-example/ # From the monorepo root
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/my-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.
To 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 devNote
These requirements are only needed for developing the source code of Vike. The npm package vike itself can be used with Windows and with any package manager.
- Node.js
>=16.0.0 - pnpm
>=9.0.0 - Unix (Linux or macOS)
Note
To install pnpm run:
npm install -g pnpm(Or see pnpm Docs > Installation for alternative methods.)