Skip to content

Environment Setup ​

To build plugins for Luna Park, a modern IDE such as WebStorm or Visual Studio Code is recommended. Basic knowledge of TypeScript and Vue is also required.

Downloading the Boilerplate ​

Start by cloning the plugin boilerplate repository:

bash
git clone https://github.com/lunapark/plugin-boilerplate

INFO

We use PNPM instead of NPM. If you don't have it installed, you can install it using npm install -g pnpm.

Next, install the project dependencies:

bash
pnpm install

Testing Your Plugin ​

To test your plugin (or the boilerplate), you will need to run two separate terminal instances:

  1. One to build the plugin and watch for changes:
bash
pnpm run dev
  1. One to serve the plugin:
bash
pnpm run preview

The preview script runs luna-preview, a small server provided by @luna-park/plugin. It serves your build on port 2084 and resolves its npm imports through esm.sh, like the editor does for published plugins.

You can now install the plugin directly in Luna Park. Open a project or the playground editor, then click Libraries > Install plugins.

Locate the "Install from URL" input field at the bottom of the plugins panel.

Install from URL

Paste your plugin's URL (default: http://127.0.0.1:2084) and press Enter.

You should see the message Plugin Boilerplate successfully installed. in the console.

Building Your Plugin ​

To build your plugin for distribution, run the following command:

bash
pnpm run build