
Template details
vite-ts-lib-starter
A simple library template starter for Vite with TypeScript, Prettier, Vitest, Bun, Renovate and np.
About this template
Vite TypeScript Library Starter is a GitHub boilerplate template that scaffolds a publishable JavaScript/TypeScript library using Vite library mode, TypeScript, Vitest, Bun, Prettier, Renovate, and np, created by developer matronator.
What is Vite TypeScript Library Starter?
Vite TypeScript Library Starter is a starter template for developing libraries with Vite and TypeScript. It takes an empty project scaffolded via clone, GitHub's "Use this template" button, ZIP download, or the degit command, and produces a TypeScript library project with preconfigured build, test, formatting, and publishing tooling. The template is authored by GitHub user matronator, targets Vite library mode for bundling, and relies on dts-bundle-generator to generate type declaration files.
Key Features
Vite TypeScript Library Starter ships with seven tool integrations and a documented 11-step publishing checklist.
- Vite library mode — Vite is configured as the build tool, so running
npm run buildgenerates production files for npm distribution from the source in thesrcfolder. - TypeScript with bundled declarations — TypeScript provides typing, and the
dts-bundle-generator.config.jsfile controls the output declaration file through itsoutFilefield, which you rename to match your library. - Vitest test runner — Tests live in the
testsfolder and run on Vitest, Vite's native test runner, so test setup mirrors the build configuration. - Bun package manager — Bun is the recommended package manager, and
bunx degit matronator/vite-ts-lib-starter my-new-libraryscaffolds a new project in one command. - Prettier formatting — Prettier is preconfigured as an opinionated code formatter, so library code style is consistent out of the box.
- Renovate dependency updates — Mend's Renovate automates dependency updates for the repository, keeping tooling versions current.
- np release workflow — The
npm run releasescript runs np, which improves the standardnpm publishexperience with additional checks and prompts.
Who is it for?
Vite TypeScript Library Starter fits developers who publish JavaScript libraries and want build, test, and release tooling decided for them.
- TypeScript library authors — developers who want a working Vite and TypeScript project with build output and type declarations already wired up for npm publishing.
- Open-source maintainers — maintainers who want Renovate's automated pull requests for dependency updates and np's improved release flow for publishing to npm.
- Tooling and utility developers — developers creating JavaScript libraries who need tests, formatting, and a changelog configured before writing their first line of library code.
What can you do with Vite TypeScript Library Starter?
The template supports three practical workflows that cover the lifecycle of a library project from scaffolding to publishing.
- Publish a new npm package: scaffold the project, update the package metadata, write library code in
src, runnpm run build, then publish withnpm publishor the np-basednpm run release. - Add a tested library workflow: write unit tests in the
testsfolder, run them through Vitest, and keep code formatted with Prettier. - Automate project maintenance: enable Renovate to open dependency update pull requests, and use the included
.github/FUNDING.ymlto add a GitHub Sponsors funding link.
How does the template work?
Install by cloning the repository, clicking "Use this template" on GitHub, downloading the ZIP, or running bunx degit matronator/vite-ts-lib-starter my-new-library. After installation, follow the README checklist: rename package.json fields, set the outFile in dts-bundle-generator.config.js, replace the logo and funding file, then write code in src and tests in tests. When the library is ready, npm run build produces the production files, and npm publish or npm run release ships them.
FAQ
Is Vite TypeScript Library Starter free to use?
Yes. It is a public GitHub template repository, and the repository includes a LICENSE.md file that you are instructed to personalize. The author also accepts GitHub Sponsors contributions, but the template itself is open for anyone to clone or use as a GitHub template.
What tools does Vite TypeScript Library Starter include?
The template bundles Bun, Vite, TypeScript, Vitest, Prettier, Renovate, and np. Vite compiles the library in library mode, Vitest runs the tests, Prettier formats the code, Renovate automates dependency updates, and np provides a clearer publishing flow.
How do I create a new library from this template?
You can click the "Use this template" button on the GitHub page, clone the repository, download it as a ZIP, or run bunx degit matronator/vite-ts-lib-starter my-new-library. All four options produce a fresh copy that you can rename and customize.
What files must I change before publishing?
The README lists 11 steps: update package.json, change the outFile in dts-bundle-generator.config.js, replace the logo, modify .github/FUNDING.yml, replace README.md, change the name in LICENSE.md, replace CHANGELOG.md, then build and publish.















