Appearance
Publish your Plugin to NPM
Main export
Since Flux Plugins use web-components as channels/views, your main export needs to be an instance of a HTMLElement.
This example shows how to turn a preact app into a web component using the bundled custom-element.js
file.
ts
// main.ts
import { toCustomElement } from "@coasys/flux-react-web";
import App from "./App";
const CustomElement = toCustomElement(App, ["perspective", "source"], {
shadow: false,
});
export default CustomElement;
NPM Package
In order to make your Flux Plugin available to your and/or other commities you need to first update your package.json
This will allow the app to be discovered by the Flux Plugin Store.
json
{
"name": "your-flux-plugin",
"version": "1.0.0",
"fluxplugin": {
"name": "My plugin",
"description": "Description of your plugin",
"icon": "icon-name"
},
"keywords": [
"flux-plugin"
],
"scripts": {},
"dependencies": {}
}
After this is done, publish your npm package.