0.1.5 • Published 4 years ago
figpack v0.1.5
Figpack
EXPERIMENTAL / WORK IN PROGRESS
A simple build tool for Figma plugins based on webpack.
It's optimized for plugins that could get complex, meaning multiple commands, multiple UIs, several npm dependencies, etc.
Usage
Scaffold a new plugin
To start writing a new plugin:
$ npx figpack init <dir>You can also use the opinionated React + react-figma-plugin-ds template:
$ npx figpack init --template react <dir>Build your plugin
$ npx figpack build # build once
$ npx figpack build -w # build + watchOr if you've created your plugin with the init script:
$ npm run build # build once
$ npm start # build + watchHow it works
Figpack handles a couple typically very boilerplate-y things for you:
- It expects a
commandsfolder in your plugin, that has each command as a separate module (e.g.commands/cmd1.tsorcommands/cmd1/index.ts). - It automatically detects the presence of a
ui.html(or .tsx, .jsx, .ts, .js) for each command, compiles it if needed, and exposes it through the__html__global variable.
License
Apache 2.0