Skip to main content

Libraries and bundling

In the plugin manifest section, we covered how to setup a single Figma project. But all the code must be in one file, which doesn't scale for very long. This section is about:

  • How do I split my code into multiple files?
  • How to I organize my JS, HTML and CSS files?
  • How can I use libraries such as React?

The short answer to these questions is: just like most people do with websites these days. Most production websites use hundreds of files and libraries, but don't have a hundred <script> tags. They also bundle all their files into a single code file.

For examples, check out our esbuild sample and Webpack sample in the plugin-samples repository.