Run and build Figma Make exported code locally with automatic dependency resolution and asset handling
triggers
["how do I run Figma Make code locally","setup local environment for Figma exported code","build single HTML file from Figma Make project","resolve Figma Make import errors","handle figma:asset imports locally","remove version specifiers from Figma imports","convert Figma Make to standalone HTML","troubleshoot Figma Make dependencies"]
Figma Make Local Runner is a TypeScript/React development environment that runs code exported from Figma Make locally. It solves common issues with Figma Make exports including:
Automatic version specifier removal from imports (e.g., @radix-ui/react-slot@1.1.2 → @radix-ui/react-slot)
Custom asset resolution for figma:asset/ imports
Pre-installed dependencies commonly used by Figma Make
Single HTML build capability for standalone distribution
Installation
# Clone the repository
git clone https://github.com/likang/figma-make-local-runner
cd figma-make-local-runner
# Install dependencies
npm install
Project Setup
1. Import Figma Make Code
After exporting code from Figma Make:
# Extract downloaded zip and copy src foldercp -r /path/to/figma-make-export/src ./src
The src folder structure should contain:
App.tsx or main component files
assets/ - images, fonts, SVGs
Component files generated by Figma Make
2. Start Development Server
npm run dev
Access at http://localhost:5173
3. Build for Production
Standard Build:
npm run build
Single HTML File (standalone):
npm run build:single
This creates a single HTML file in dist/ with all assets inlined - perfect for sharing or embedding.
Key Commands
# Development server with hot reload
npm run dev
# Type checking
npm run type-check
# Production build (standard)
npm run build
# Production build (single HTML file)
npm run build:single
# Preview production build
npm run preview
Common Patterns
Handling Missing Dependencies
If you encounter import errors, install the missing package: