An example project for the Figma plugin with React.js, React Router, and Tailwind CSS.
Refer to this post for more information.
Clone this project, and then...
To install dependencies:
$ yarn install
To build the plugin:
$ yarn run build
This will generate a dist/
directory containing the JavaScript bundles for the plugin.
To watch for code changes and rebuild the plugin automatically:
$ yarn run watch
To upgrade packages:
npm install -g syncyarnlock
yarn upgrade --latest
syncyarnlock -s -k
Import plugin from manifest…
via the Quick Actions search bar.Menu bar
> Plugins
> Development
> Import plugin from manifest…
manifest.json
file.Use console.log
statements to inspect values in your code.
To open the developer console, search for and run Open Console
via the Quick Actions search bar.
Menu bar
> Plugins
> Development
> Show/Hide console
Official docs and code samples from Figma:
I referenced the project's configuration and structure below.
Figma plugin boilerplates with React.js, TailwindCSS
Routing on Figma plugin.
Related to Tailwind CSS
command + option + p
to re-run the last plugin. -> This works for me. But I'm not satisfied with this solution...