Application entry file main.js in the .app/Contents/Resources/app.asar does not exist
Application entry file main.js in the .app/Contents/Resources/app.asar does not exist
·
问题:electron打包报错:
Application entry file "main.js" in the "xxx/mac/mitmdumpUrlSaver.app/Contents/Resources/app.asar"
does not exist. Seems like a wrong configuration.
原因:根目录 [package.json] --> [build] --> [files]
原先配置为:
"files": [
"electrondist",
"electrondistfile"
]
根据官网
files - Application Contents - electron-builder 解释,默认files
配置是:
"files": [
"**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!.editorconfig",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}",
]
其中的 **/*
包含了根目录下的各种核心文件,包括入口文件main.js
所以:
"files": [
"**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!.editorconfig",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}",
"electrondist",
"electrondistfile"
],
OK!
更多推荐
已为社区贡献1条内容
所有评论(0)