Skip to main content

Create Plugin

We can quickly create a new plugin via cli.

npx mini-star createPlugin

mini-star will ask some questions through an interactive terminal program to finally create a plugin.

Plugins will be automatically placed in the plugins/ directory of the root directory.

Now, let's try to create a plugin called test:

At this time, the <root>/plugins directory should be as follows:

./plugins
└── test
├── package.json
├── src
│   └── index.ts
└── tsconfig.json

One of the simplest plugins is complete, start your plugin journey with index.ts as the entrance

Compile the plugin

In order for the plugin to be loaded correctly, don't forget to use ministar to compile the plug-in code after each modification. By default, it will be packaged and output to the dist/plugins directory of the current directory.

You can also modify the output by modifying outDir in the configuration file.

npx mini-star buildPlugin test

# or

npx mini-star buildPlugin all