Plugin Deployment with base path

Hello everyone,

I recently tried to publish a penpot plugin with a URL base path and failed to correctly configure it. So I went without a base path and used only a subdomain for publishing the plugin.

If I remember correct, I was able to configure it to use and resolve the the plugin.js and manifest.json under the base path, but whenever I accessed the plugin’s index.html by opening the plugin’s UI, it was accessing the index.html without the base path.

So my quesiton is, has anyone managed to publish a plugin with a base path in the URL, like https://example.com/path/[index.html|manifest.json|plugin.js]?

2 Likes

All you need to do to make the plugin files run from the correct subfolder is to specify the full paths to the plugin code in manifest.json and the UI file in the penpot.ui.open() method.

For example:

// manifest.json
{
  "code": "https://example.com/full/path/to/plugin.js",
  …
}
// plugin.js
penpot.ui.open(
  'Plugin Name',
  'https://example.com/full/path/to/index.html'
)
1 Like

Thanks for the info. I did not notice there was a URL param there, but now that you mention it that makes sense. :grin: