Skip to content
This repository was archived by the owner on Jul 31, 2019. It is now read-only.

Latest commit

 

History

History
81 lines (55 loc) · 1.43 KB

File metadata and controls

81 lines (55 loc) · 1.43 KB

Figma Plugin Boilerplate

Kickstart your awesome Figma plugin with this boilerplate.


Features

  • Modern Javascript (ES6)
  • Tests using Jest
  • Transpiling using Babel and bundle using Rollup
  • Code formatting with Prettier

Code Demo

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);
  }
}

Download & Development

$ git clone https://github.com/figma-plus/plugin-boilerplate
$ yarn install
$ yarn serve
$ yarn test

Build a Distribution Bundle

$ yarn build

You'll see your bundle inside dist directory. Follow the docs instructions to publish it.

License

This project is licensed under the MIT License