vite-plugin-slidev-manager
v0.0.7
Published
A Vite plugin for managing multiple Slidev presentations in a monorepo structure.
Maintainers
Readme
vite-plugin-slidev-manager
A Vite plugin for managing multiple Slidev presentations in a monorepo structure. It provides an interactive CLI to select and launch presentations for development or export.
Features
- Interactive CLI: Uses Ink to provide a user-friendly terminal interface.
- Monorepo Support: Automatically discovers presentations in a
presentationsdirectory. - Dev & Export Modes:
- Dev: Select a presentation to start the Slidev development server (
slidev). - Build: Select a presentation to export as PDF (
slidev export).
- Dev: Select a presentation to start the Slidev development server (
- Seamless Integration: Hooks directly into Vite's
configureServerandbuildStartlifecycles.
Installation
npm install -D vite-plugin-slidev-manager
# or
yarn add -D vite-plugin-slidev-manager
# or
pnpm add -D vite-plugin-slidev-managerUsage
1. Configure Vite
Add the plugin to your vite.config.ts (or vite.config.mts):
import { defineConfig } from 'vite';
import presentationManager from 'vite-plugin-slidev-manager';
export default defineConfig({
plugins: [
presentationManager({
presentationsDir: 'my-presentations' // Optional: default is 'presentations'
})
]
});2. Add Scripts
In your root package.json, set up the scripts to trigger Vite:
{
"scripts": {
"dev": "vite",
"build": "vite build"
}
}3. Run
- Development: Run
npm run dev. You will see a list of presentations. Select one to start editing. - Export: Run
npm run build. You will see a list of presentations. Select one to build/export (currently PDF only).
Directory Structure
The plugin expects a presentations directory in the root of your project. Each subdirectory should contain a Slidev presentation (either a slides.md file or a package.json defining a workspace).
my-project/
├── package.json
├── vite.config.ts
├── presentations/
│ └── my-presentation-2/
│ └── slides.mdTroubleshooting
Vulnerability Warnings
If you encounter vulnerability warnings related to monaco-editor (via dompurify), you can resolve them by adding an override to your project's package.json. This is due to a dependency in monaco-editor which is used by Slidev.
{
"overrides": {
"monaco-editor": "^0.55.1"
}
}