我有一个非常特殊的问题,我有一个用Preact构建的中微子应用程序,在使用neu run运行时运行的非常好,但是,一旦我构建了这个项目(有enableServer打开或关闭),构建的应用程序将不会加载任何东西。
打开enableServer后,它会抱怨无法连接到localhost:“找不到此本地主页”。
关掉它,我就有了一个完全白色的屏幕/DOM。
GitHub存储库在这里:https://github.com/SpikeHD/XeniaLauncher
我怀疑这可能是我构建该项目的方式,但我发现neu run工作完全正常是很奇怪的。
以下是我的配置:
{
"applicationId": "js.xenia_launcher.app",
"version": "1.0.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/build/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true
},
"nativeAllowList": [
"app.*",
"os.*",
"filesystem.*",
"storage.*",
"window.*",
"debug.log"
],
"modes": {
"window": {
"title": "XeniaLauncher",
"width": 1000,
"height": 800,
"minWidth": 400,
"minHeight": 200,
"fullScreen": false,
"alwaysOnTop": false,
"icon": "/resources/icons/appIcon.png",
"enableInspector": true,
"borderless": false,
"maximize": false,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
},
"browser": {},
"cloud": {
"url": "/resources/#cloud",
"nativeAllowList": [
"app.*"
]
},
"chrome": {
"width": 1000,
"height": 800,
"args": "--user-agent=\"Neutralinojs chrome mode\""
}
},
"cli": {
"binaryName": "XeniaLauncher",
"resourcesPath": "/resources/",
"extensionsPath": "/extensions/",
"clientLibrary": "/resources/js/neutralino.js",
"binaryVersion": "4.4.0",
"clientVersion": "3.3.0"
}
}发布于 2022-04-01 02:32:30
修好了!最后,我只设置了一些脚本,这些脚本将把所有已构建的Preact代码放入resources文件夹中,并重新设置我的配置,使其只使用资源文件夹,比如原始的中微子模板。我相信有一个更优雅的方式,但我仍然只是学习中微子和Preact,所以这是非常好的工作对我来说。
发布于 2022-07-29 13:34:41
看起来,需要将resourcesPath设置为找到index.html的目录。我有一个public dir,并将图标移到那里,然后将resourcesPath设置为/public/,然后能够neu build --release并运行。
https://stackoverflow.com/questions/71687057
复制相似问题