Skip to content

Getting Started

Marmotte is an extensible development toolkit for TypeScript projects. It provides composable Vite plugins that handle the boring parts of project setup — bundling, type declarations, documentation, and testing — so you can focus on your actual code.

Installation

sh
npm install --save-dev marmotte

Marmotte has optional peer dependencies depending on which plugins you use:

FeaturePeer dependency
All pluginsvite, typescript
Documentationvitepress
Testing utilitiesvitest
Vue routingvue-router

What's included

Import pathPurpose
marmotte/vite/libBuild a TypeScript library
marmotte/vite/uiBuild a Vue + Vuetify app or library
marmotte/vite/docsEmbed VitePress docs in your dev server
marmotte/vitepress/typedocAuto-generate API reference from JSDoc
marmotte/vitepress/sidebarAuto-generate VitePress sidebar
marmotte/vitestHelpers for tests

Concepts

Plugin composition

Functions exported from marmotte/vite/<plugin-name> return a Vite Plugin or Plugin[]. You use them directly inside the plugins array of your vite.config.ts:

ts
import { defineConfig } from "vite"
import { Lib } from "marmotte/vite/lib"

export default defineConfig({
  plugins: Lib(),
})

Higher-level plugins (Lib, UILib, UIApp) are pre-composed bundles of lower-level ones. You can always drop down to individual plugins when you need more control.

Auto-managed vs default files

When the Docs plugin is active it writes two kinds of files into docs/:

  • Default files (e.g. docs/index.md, docs/.vitepress/config.ts) — written once on first run. You are free to edit them; they won't be overwritten.
  • Auto-managed files — always regenerated. Do not edit them. If you do, a .backup copy is created.

Entry point discovery

Lib (and LibConfig) use resolveEntries to walk your src/ directory and build a Rollup entry map automatically. Control which files become entries with a RegExp or predicate via the entries option.

Next steps