Open-source project
vuejs/router avatar
vuejs/router

Vue Router: one npm command to install, and a bundle size budget to respect

🚦 The official router for Vue.js

4,709 stars1,322 forksTypeScriptMIT

At a glance

What is it?
Vue Router is the official router for Vue.js, currently on its fifth major. Using it takes a single install line, but the repository is where the interesting decisions sit: a brotli size check, browser based tests through Playwright, oxlint and oxfmt instead of the usual Vue defaults, and a documentation pipeline that generates, diffs and deploys the site.
Who is it for?
Vue Router fits a Vue application that wants the official routing layer with a published support policy, and it fits contributors who are willing to use this repository's own tooling rather than their editor defaults. It does not fit a project still on Vue Router 4, since the current major is 5 and the install line asks for it explicitly.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • vuejs/router4,709 ★ · +27
Star history
Repository2026-09-232026-11-15
vuejs/router4.7k4.7k

27 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The install line asks for the major explicitly

There is one quickstart path and it is a single command:

bash
npm install vue-router@5

The `@5` is doing work. The most recent tags are v5.4.0 on 2026-10-07, v5.3.1 on 2026-09-02 and v5.3.0 on 2026-08-27, so the fifth major is what ships today, and the documentation asks you to name it rather than take a floating latest. If your application is on Vue Router 4, this line is a major upgrade rather than a patch, and the README does not summarise what changed between the two.

The other quickstart entry is an in-browser playground, which is the fastest way to see a route configuration behave before you touch a project.

For versions in support, the README deliberately does not answer that itself. It points at the Security Policy inside the router package, which is the file to read if you are deciding whether a given release still receives fixes. Supported version is a policy question, and the policy lives in one document rather than in the tag list.

A size budget is a script, not a convention

Most libraries measure their bundle size the way a build tool does, quietly. This one has a dedicated script for it:

json
"release": "node scripts/release.ts",
"size": "node scripts/check-size.mjs",

and a matching `build:size` script that runs across packages. The `brotli` package sits in devDependencies, which tells you the measurement is taken on compressed output rather than raw bytes, since that is the number a browser actually downloads.

For a reader deciding whether to depend on the router, this is one of the more useful signals in the repository. A routing layer that is on every page of an application cannot grow without consequence, and a maintainer who keeps a size script has to justify each addition against a number. It also means the size claim is checkable rather than asserted: the check is a command in the tree, not a sentence in a README.

The measurement itself lives in `scripts/check-size.mjs`.

The default test suite runs in a real browser

The root scripts delegate everything to the packages:

json
"test": "pnpm run -r test",
"lint": "oxfmt --check && oxlint",
"lint:fix": "oxlint --fix && oxfmt",
"postinstall": "simple-git-hooks"

What sits behind that test command matters. The devDependencies include `vitest` at `^5.0.3`, `@vitest/browser-playwright` at `^5.0.3` and `playwright` at `^1.63.0`, plus `@vitest/coverage-v8` with a `codecov.yml` at the repository root. So browser testing through Playwright is part of the toolchain, and coverage is reported.

That choice fits the subject. A router's hardest failures are the ones that only appear against a real history implementation, a real navigation event or an actual browser timing, and a jsdom suite would mock away exactly the code under test.

The cost is contributor setup. `pnpm test` needs browsers installed, not just a Node runtime. BrowserStack is credited in the README for letting the maintainers debug browser specific issues, which is the other half of that same problem.

Lint and format are oxlint and oxfmt

This is the detail that surprises people arriving from another Vue repository. The lint pipeline is not ESLint and Prettier:

text
lint        oxfmt --check && oxlint
lint:fix    oxlint --fix && oxfmt

`oxfmt` at `^0.72.0` and `oxlint` at `^1.87.0`, configured through `.oxfmtrc.jsonc` and `.oxlintrc.jsonc`, with `lint-staged` at `^17.6.0` for staged files and `simple-git-hooks` wiring it up after install.

Two consequences. A contributor who copies the lint setup from another Vue project will find the wrong tools and the wrong rules. Meanwhile the `postinstall` hook means the git hooks are installed as a side effect of `pnpm install`, which is convenient and also means a fresh clone behaves differently from a checkout where someone skipped install.

The repository also carries `.node-version` to pin the Node version and TypeScript at `~6.0.3`, so the toolchain is declared rather than inferred.

Docs are generated, translated and deployed separately

The published documentation is a build product with its own pipeline, and the scripts show the stages. `docs:api` runs inside the docs package, `typedoc` at `^0.28.20` with `typedoc-plugin-markdown` generates the API reference from the TypeScript sources, and `docs:build` runs the API step before the site build.

Then there is the translation machinery, which is three scripts rather than one: `docs:translation:compare`, `docs:translation:update` and `docs:translation:status`. A compare step implies the translated pages can drift from the English source and that the drift is detected mechanically, which is the only way a multi language documentation site stays honest over years.

Deployment is `netlify.toml` plus a `netlify` script that builds the router package and then the docs, with `docs:preview` for a local look. The practical consequence for a user is that what you read at router.vuejs.org is generated, so a gap you find there is a gap in the TypeScript comments or in the docs package rather than something you can patch from a browser tab.

Releases are an interactive script with a forked prompt library

Publishing is `node scripts/release.ts`, and one devDependency tells you what kind of script it is. The prompt library is declared as an alias:

json
"@clack/prompts": "npm:@posva/clack-prompts@^1.2.2"

The package name `@clack/prompts` resolves to a personal fork rather than the upstream release, at `^1.2.2`. A prompt driven release script is interactive, so this is a maintainer workflow run from a terminal rather than a CI publish, and the alias is a small sign of how much of this tooling lives with the person who maintains it.

Changelog generation is automated from commits: `conventional-changelog` at `^8.1.3` with `conventional-changelog-angular` at `^9.4.0`. Tags therefore follow commit message conventions, which is the part that affects outsiders: a good commit subject ends up in the release notes.

Master is a month ahead of the newest tag

v5.3.0 shipped on 2026-08-27, v5.3.1 on 2026-09-02 and v5.4.0 on 2026-10-07, and the last push to the repository is dated 2026-11-01.

So the default branch has been receiving work for more than three weeks with no tag covering it. That is ordinary for a project of this size, and it has one practical consequence for consumers: pinning a version and tracking the branch are two different experiences, and only the pin is reproducible.

The repository root also carries files that describe how the project is worked on rather than what it does. `CLAUDE.md` is an instruction file for tooling, `.coderabbit.yaml` configures CodeRabbit, which is also the single gold sponsor listed in the README, alongside VueMastery, Controla, SendCloud, RTVision and Storyblok. `.git-crypt/` at the top level means some repository content is encrypted, so a clone may need a key before every file is readable.

Editorial conclusion

Vue Router fits a Vue application that wants the official routing layer with a published support policy, and it fits contributors who are willing to use this repository's own tooling rather than their editor defaults. It does not fit a project still on Vue Router 4, since the current major is 5 and the install line asks for it explicitly. Verify two things before you start: which versions the Security Policy in `packages/router/SECURITY.md` still supports, since that file rather than the tag list defines coverage, and whether your build can tolerate a browser based test suite if you intend to contribute, because Playwright is part of the test toolchain.

Frequently asked questions

How do I add Vue Router to an existing Vue project?

Run `npm install vue-router@5`. The README also points at an in-browser playground for trying a route configuration before you change a project, and the documentation at router.vuejs.org for everything else.

Which Vue Router versions are still supported?

The README does not say; it points at the Security Policy in `packages/router/SECURITY.md` for the versions currently supported. The most recent tags are v5.4.0 on 2026-10-07, v5.3.1 on 2026-09-02 and v5.3.0 on 2026-08-27.

How does the Vue Router repository run its tests?

With vitest 5.0.3 including `@vitest/browser-playwright` and `playwright` 1.63.0, plus v8 coverage feeding a root `codecov.yml`. The root test script is `pnpm run -r test`, which runs each package's own suite.

Which linter and formatter does Vue Router use?

oxlint with oxfmt. The `lint` script runs `oxfmt --check && oxlint` and `lint:fix` runs `oxlint --fix && oxfmt`, configured through `.oxlintrc.jsonc` and `.oxfmtrc.jsonc`, with lint-staged and simple-git-hooks wiring it into commits.

Does Vue Router track its own bundle size?

Yes. The `size` script runs `node scripts/check-size.mjs`, a root `build:size` script runs `build:size` across the packages, and `brotli` is a devDependency, so the measurement is on compressed output.

Where do the Vue Router docs come from?

They are generated. TypeDoc with typedoc-plugin-markdown feeds the `docs:api` step, the docs package has its own docs scripts including translation compare, update and status, and `netlify.toml` holds the deployment configuration for the published site.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. vuejs/router on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/vuejs-router.svg)](https://hysenlabs.com/projects/vuejs-router)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/vuejs-router.svg)](https://hysenlabs.com/projects/vuejs-router)

Was this useful?