0.0.4 • Published 6 years ago
figmake v0.0.4
Figmake

A tiny CLI for making Figma plugins with HTML, CSS, and vanilla JavaScript
- Stitches together
ui.html,ui.scss, andui.jsinto a single HTML file for your plugin UI - Automatically inlines any image assets into the generated HTML file
Goals
- As few files as possible
- No
package.jsonornode_modules - No TypeScript
- No JavaScript UI framework; just use
figma-plugin-ds - No API; just use the Figma plugin API
- Tiny CLI that just does one thing
Quick start
Requires Node.js.
First:
$ npm i -g figmakeFigmake assumes that your plugin code comprises the following files:
main.js
manifest.json
ui.scss
ui.html
ui.js(Of these, only main.js and manifest.json are mandatory.)
manifest.json should look something like:
{
"name": "My Plugin",
"id": "314159265358979323",
"api": "1.0.0",
"main": "build/main.js",
"ui": "build/ui.html"
}To build the plugin:
$ figmakeThis will generate the following two files:
build/main.js— The plugin entry point, built frommain.js.build/ui.html— HTML file for the plugin UI, stitched together fromui.html,ui.scss, andui.js.ui.scsswill be compiled down to CSS.- Image assets referenced in
ui.htmlandui.scsswill be inlined into the resulting HTML file.
To watch for code changes and rebuild the plugin automatically:
$ figmake -wTo minify the output files:
$ figmake -m