Vue 3 + Vite Setup
Step-by-step guide to integrate Frontfriend with Vue 3 and Vite
Frontfriend Integration Guide for Vue 3 + Vite
This guide will walk you through integrating Frontfriend with your Vue 3 + Vite project.
Prerequisites
- Vue 3 + Vite project already created
- Node.js >= 16
- Tailwind CSS installed (or will be installed)
Installation
Step 1: Install Dependencies
Step 2: Create Configuration
Create frontfriend.config.js in your project root:
Step 3: Configure Tailwind
Update tailwind.config.js:
Step 4: Setup CSS
Create or update src/style.css:
Import in src/main.js:
Step 5: Configure Vite Plugin
Update vite.config.js:
Step 6: Initialize Design Tokens
This creates a local cache of your design system tokens.
Step 7: Download Vue Components
Components will be downloaded to src/components/ui/ (as configured in your aliases).
Using Design Tokens
After initialization, use your design tokens as Tailwind utilities:
CLI Commands
npx frontfriend init- Initialize/update design tokensnpx frontfriend init --force- Force refresh tokensnpx frontfriend status- Check configuration statusnpx frontfriend download <components> -f vue- Download componentsnpx frontfriend clean- Clear token cache
Troubleshooting
Styles not applying
- Check that
npx frontfriend initcompleted successfully - Verify cache exists:
npx frontfriend status - Force refresh:
npx frontfriend init --force
Components in wrong location
- Check your
frontfriend.config.jshas correctuialias - Use
-oflag to override:npx frontfriend download button -f vue -o ./src/components
ff-id not found
- Ensure
frontfriend.config.jsexists in project root - Verify the
ff-idfield is present and correct