What is the correct way of adding a menu without having separate .ts files? #165
-
My plan is to add several commands to the plugin menu, which call different functions in For instance ...
... gets converted to the following in
When I'm trying to add the following directly in
Thank you in advance 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Instead of only using the "menu": [
{
"name": "Command 1",
"main": {
"src": "src/main.ts",
"handler": "commandOne"
},
"ui": "src/ui.tsx"
},
"-",
{
"name": "Command 2",
"main": {
"src": "src/main.ts",
"handler": "commandTwo"
},
"ui": "src/ui.tsx"
}
] Your export function commandOne () {
// ...
}
export function commandTwo () {
// ...
}
I do not recommend manually editing the |
Beta Was this translation helpful? Give feedback.
Instead of only using the
default
export for all the commands, you can specify a particular named export for each command instead. For example:Your
src/main.ts
can then be something like: