Skip to content

Instantly share code, notes, and snippets.

@svallory
Created October 25, 2021 00:26
Show Gist options
  • Save svallory/e187e62e79600f2c79de1b7b826c01e1 to your computer and use it in GitHub Desktop.
Save svallory/e187e62e79600f2c79de1b7b826c01e1 to your computer and use it in GitHub Desktop.
Figma Plugin Development Live Reload

Figma Plugin Development Live Reload

  1. Create a run-plugin.sh somewhere in your project
  2. Copy the code from the run-plugin.sh file in this gist
  3. Install nodemon with yarn add --dev nodemon
  4. Add a script in the scripts property of your package.json replacing PLUGIN_CODE_FOLDER by the path to the folder where your plugin code lives
    "scripts": {
      "livereload": "nodemon --watch PLUGIN_CODE_FOLDER --exec run-plugin.sh"
     }
    
  5. Run your livereload task with yarn livereload
#!/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