Kickstart your awesome Figma plugin with this boilerplate.
- Modern Javascript (ES6)
- Tests using Jest
- Transpiling using Babel and bundle using Rollup
- Code formatting with Prettier
export default class ExamplePlugin {
constructor() {
this.options = [
"Alert File Name",
this.main.bind(this),
null,
{ shift: true, option: true, key: "t" }
];
const { figmaPlugin } = window;
figmaPlus.createPluginsMenuItem(...this.options);
window.examplePlugin = this;
}
main() {
const { App, alert } = window;
const fileName = App.getCurrentFileName();
alert(fileName);
}
}
$ git clone https://github.com/figma-plus/plugin-boilerplate
$ yarn install
$ yarn serve
$ yarn test
$ yarn build
You'll see your bundle inside dist
directory.
Follow the docs instructions to publish it.
This project is licensed under the MIT License