storybook-config

Configure Storybook to reuse the app's shared Vite/Tailwind/alias setup via viteFinal.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill storybook-config-matthewharwood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storybook-config
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/storybook-config
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill storybook-config-matthewharwood

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reconcile Storybook and app configurations by reusing a single shared Vite/Tailwind/alias setup, eliminating drift and duplication.

Core Features & Use Cases

  • Shared Vite config: main.ts, preview.tsx, and viteFinal merge into the app's Vite config.
  • Parity across environments: ensures Storybook renders with the same tokens, aliases, and plugins as the app.
  • Safe upgrade path: reduces maintenance burden by pinning to a single source of truth for tooling.

Quick Start

Configure Storybook to reuse the app's Vite/Tailwind/config by wiring viteFinal to merge in app plugins and path aliases.

Frequently Asked Questions about storybook-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I share Vite and Tailwind config between Storybook and my app?

To share Vite and Tailwind config between Storybook and your app, wire the viteFinal export in Storybook's main.ts to merge your app's existing plugins and path aliases, ensuring rendering parity and eliminating duplicate configuration.

Why does my Storybook Tailwind config drift from my main app?

Storybook Tailwind config drifts when it duplicates plugin setups instead of reusing the app's source. Integrating a single shared Vite configuration via viteFinal prevents this drift and ensures identical design tokens across both environments.

How do I configure TypeScript path aliases in Storybook?

Configure TypeScript path aliases in Storybook by integrating vite-tsconfig-paths within your shared Vite setup. This aligns TS paths between your app and Storybook, allowing imports to resolve correctly without manual alias duplication.

What is the best way to avoid duplicate Vite plugins in Storybook?

The best way to avoid duplicate Vite plugins in Storybook is to use a single shared Vite configuration integration. By merging the app's config through viteFinal, you pin Storybook to one source of truth and remove redundant plugin declarations.

Can I reuse my app's Vite config directly inside Storybook preview.tsx?

Yes, you can reuse your app's Vite config inside Storybook by merging it through the viteFinal integration in main.ts. This ensures preview.tsx renders components with the exact same Tailwind tokens and aliases as your main application.

Does Storybook viteFinal support reusing existing Tailwind setup?

Storybook's viteFinal supports reusing an existing Tailwind setup by merging the app's Vite configuration into Storybook. This approach requires a single shared integration to safely upgrade and maintain tooling parity without configuration duplication.