mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-02-02 04:19:14 -05:00
35 lines
603 B
Markdown
35 lines
603 B
Markdown
|
npx nx g @nx/web:application example-plugin --directory=apps/example-plugin
|
||
|
|
||
|
Create a manifes.json in /public
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"name": "Example plugin",
|
||
|
"code": "http://localhost:4201/plugin.js"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Add to the example vite.config.ts
|
||
|
|
||
|
```json
|
||
|
build: {
|
||
|
rollupOptions: {
|
||
|
input: {
|
||
|
plugin: 'src/plugin.ts',
|
||
|
index: './index.html',
|
||
|
},
|
||
|
output: {
|
||
|
entryFileNames: '[name].js',
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Run static server `npx nx run example-plugin:serve-static --port 4201`
|
||
|
|
||
|
Go to penpot and load the plugin.
|
||
|
|
||
|
```ts
|
||
|
ɵloadPlugin({ manifest: 'http://localhost:4201/manifest.json' });
|
||
|
```
|