Plugins
TL;DR: in jbrowse-web and jbrowse-desktop, add a plugin by listing its
name (which must match the name the plugin registers itself under) and bundle
url in the top-level plugins array.
{
"plugins": [
{
"name": "GDC",
"url": "https://unpkg.com/jbrowse-plugin-gdc/dist/jbrowse-plugin-gdc.umd.production.min.js"
},
{
"name": "MyPlugin",
"esmLoc": { "uri": "plugin.js" }
}
]
}
namemust match the plugin's own registration (name = 'GDC'in the plugin class), or the plugin fails to load.- The plugin store lists unpkg URLs for published plugins, which you can also download to your own server. Plugin authors submit a PR to jbrowse-plugin-list.
- Embedded components load plugins inline; see the inline plugins example.
url is the simplest field and equals umdUrl. The others differ in module
format and in what the path resolves against:
| Field | Module format | Path resolved relative to |
|---|---|---|
url | UMD | index.html |
umdUrl | UMD | index.html |
umdLoc | UMD | config.json |
esmUrl | ESM | index.html |
esmLoc | ESM | config.json |
cjsUrl | CJS | index.html (desktop only) |
umdLoc/esmLoc suit a plugin file that lives beside config.json, and cjsUrl
is for jbrowse-desktop, since Electron does not load ESM.