Skip to content

Plugin Structure

Aarav Malani edited this page Jun 6, 2026 · 1 revision

A plugin is structured as follows:

  • src/ - contains the source code for the plugin.
    • __tests__/ - contains the test cases for the plugin.
    • index.ts - the entry point for the plugin, which exports the plugin class that implements the IPlugin interface.
  • README.md - contains documentation for the plugin.
  • manifest.json - contains metadata about the plugin, as shown here.
  • package.json - contains the npm package information for the plugin.
  • tsconfig.json - contains the TypeScript configuration for the plugin.
  • rollup.config.mjs - contains the Rollup configuration for building the plugin.
  • jest.config.cjs - contains the Jest configuration for testing the plugin.

Scripts

The package.json is expected to supply certain scripts for building, testing and bundling the plugin. These include

  • build - builds the plugin to the ./dist folder
  • prepack - (only for installable plugins) usually executes build before npm publish

Clone this wiki locally