按照文档的意思,只有模板插件需要设置window.exports。
我的插件的plugin.json中已经配置了main属性,即意味着不是模板插件,所以也不需要设置window.exports函数。当我在Windows和Linux(Deepin)上进行测试时,没有任何问题,但是我在MacOS上进行测试时,却提示window.exports未配置。所以是我的配置有问题还是uTools的bug?
plugin.json:
{
"main": "settings.html",
"preload": "preload.js",
"logo": "icon.png",
"features": [
{
"code": "settings",
"explain": "文件整理设置",
"cmds": ["文件整理设置"]
},
{
"code": "start",
"explain": "整理当前目录",
"cmds": [
{
"type": "files",
"label": "整理当前文件夹",
"fileType": "directory",
"minLength": 1,
"maxLength": 1
},
{
"type": "window",
"label": "整理当前文件夹",
"match": {
"app": ["explorer.exe", "SearchApp.exe", "SearchHost.exe", "Finder.app"],
"class": ["CabinetWClass", "ExploreWClass"]
}
}
]
}
]
}
测试环境:MacOS 10.15.5;uTools V2.6.3
插件:文件整理-1.0.0.upx