我正试着用Electron 打包机打包我的Electron 角项目.打包程序将应用程序打包时没有错误,但在使用.exe文件加载应用程序时,没有正确加载任何assets资源 .在开发模式下,assets资源 可以正常工作,只有在打包应用程序时才不能正常工作.
ANGLE项目由多个库和应用程序组成,如下所示:
Root
--> Projects
--> Desktop
--> Mobile
--> Library 1
--> Library 2
assets资源 位于库1和库2中,但在构建时,所有assets资源 都合并到单个assets资源 文件夹中.
在这种情况下,我正在try 用Electron 打包Desktop个应用程序.
The output of the dist/desktop folder when buidling the desktop application in production个
All the assets inside are correct.个
Then the packaging command from electron packager:个
electron-packager ./dist/desktop MyAppName --overwrite --asar --platform=win32 --arch=x64 --icon=projects/desktop/src/assets/logo-accent.ico --prune=true --out=dist --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"MyAppName\""
The app.asar file is generated correctly inside the resources folder within the packaged application.个
Output error of an assets file when running the application:个
I created a dummby app and noticed that the assets work correctly and the path of the file should be in thefollowing format:
因此,我的原始项目中缺少红色部分.我该如何解决这个问题?