- Create a
run-plugin.sh
somewhere in your project - Copy the code from the
run-plugin.sh
file in this gist - Install nodemon with
yarn add --dev nodemon
- Add a script in the
scripts
property of yourpackage.json
replacingPLUGIN_CODE_FOLDER
by the path to the folder where your plugin code lives"scripts": { "livereload": "nodemon --watch PLUGIN_CODE_FOLDER --exec run-plugin.sh" }
- Run your livereload task with
yarn livereload
Created
October 25, 2021 00:26
-
-
Save svallory/e187e62e79600f2c79de1b7b826c01e1 to your computer and use it in GitHub Desktop.
Figma Plugin Development Live Reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
osascript <<'EOF' | |
if application "Figma" is running then | |
tell application "Figma" to activate | |
tell application "System Events" to tell process "Figma" | |
keystroke "p" using {command down, option down} | |
end tell | |
return "Running" | |
else | |
return "Not running" | |
end if | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment