https://github.com/romannurik/figui-loader
A webpack loader for bundling Figma plugin UIs into your main plugin bundle
https://github.com/romannurik/figui-loader
figma figma-plugins webpack
Last synced: about 2 months ago
JSON representation
A webpack loader for bundling Figma plugin UIs into your main plugin bundle
- Host: GitHub
- URL: https://github.com/romannurik/figui-loader
- Owner: romannurik
- License: apache-2.0
- Created: 2020-11-25T16:26:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-14T13:59:35.000Z (about 5 years ago)
- Last Synced: 2025-10-22T08:43:35.447Z (8 months ago)
- Topics: figma, figma-plugins, webpack
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED - Use [figpack](https://github.com/romannurik/figpack) instead.
---
# figui-loader
A webpack loader for bundling figma plugin UIs into your main plugin bundle.
The output of the loader is a string for a `` tag containing the UI bundle.
## Installing
Grab it from npm:
```
npm install --save-dev figui-loader
```
## Usage
Assuming your UI entrypoint is `ui.ts`, you can bundle it and use it in your plugin's main code like this:
```ts
import html from 'figui-loader!./ui';
// html is a string with <script>...
figma.showUI(html);
```
If your UI requires actual HTML (e.g. `` or a root `
`), you can either prepend it to the `html` returned by the loader, or have your UI bundle dynamically inject the required HTML into the DOM itself.
### Typings
You'll also need to add typings, so update your `tsconfig.json` with the loader's type root:
```js
{
"compilerOptions": {
...
"typeRoots": [
...
"./node_modules/figui-loader/types"
]
},
}
```