Plugins are a way to extend the functionality of the framework. You can create your own plugins and use them in your projects.
A plugin is a folder with the following structure:
plugin-name
├── index.js
├── package.json
You can also create your plugin with Hayde. First, you need to create .hayde.json
file in your project root. Then, add createPlugin
only to the plugins array.
{
"plugins": [
"createPlugin"
]
}
After that, you can run the following command to create your plugin.
npx hayde
This file is the entry point of the plugin. It should export;
pluginName
: Name of the plugininitPlugin
: Init function of the pluginrunPlugin
: Run function of the plugin after everything is ready to go for parsing the component