This is a starting template for building a Figma app using React.
This project uses Yarn workspaces, so you will need to have Yarn installed before proceeding.
yarn
yarn dev
Assets will be placed in dist/dev
.
Follow instructions here to open your plugin in Figma. You do not need to create a new plugin from template. The manifest is located in dist/dev/manifest.json
.
Your changes will be updated via the watch scripts, but you will need to manually update the plugin within Figma using Plugins > Run last plugin.
To do a production build, run:
yarn build
This is an Nx package-based monorepo.
iframe
- Code that can access the browser APIs- Built using
vite
- Note that
vite dev
doesn't output files, so we have to usevite build
- Built using
sandbox
- Code that can access the Figma "scene"- Built using
esbuild
- Note that the sandbox js is incompatible with
module
andimport
syntax, so we can only load the script using IIFE - Parcel 2 and SWC have been considered, but do not support IIFE
- Built using
common
- Common code to be shared between theiframe
andsandbox
See here for more information on Figma plugin architecture.