简体   繁体   English

NW.js-nwbuild无法在Windows上打开

[英]NW.js - nwbuild not opening on windows

I have an application building in Nw.js. 我在Nw.js中构建了一个应用程序。 Its almost done, but now facing an issue. 它几乎完成了,但是现在面临一个问题。 While on clicking nw.exe on code (development) it is opening very fast, within in 2 seconds. 在代码(开发)上单击nw.exe时,它会在2秒钟内快速打开。 But when I create a build using nwbuild -p win64 . 但是当我使用nwbuild -p win64 .创建一个构建时nwbuild -p win64 . , it is taking a lot time of time, say a minute to open and giving a feeling that app is opening itself. ,这需要花费很多时间,例如要花一分钟时间才能打开,给人的感觉是应用正在自动打开。

The code base when built, the .exe is 21 MB size. 生成后,.exe的代码库为21 MB。 Appreciate, if some one could help me to understand why this happens and what to make it open faster. 如果有人可以帮助我理解为什么会发生以及如何使其更快打开,我将不胜感激。

nwbuild is not recommended by official now, maybe try nwjs-builder-phoenix or create you own distribute script. nwbuild现在不被官方推荐,也许尝试nwjs-builder-phoenix或创建自己的分发脚本。 As I remember, nwjs-builder-phoenix also not handle node_modules folder size very good. 我记得,nwjs-builder-phoenix也不能很好地处理node_modules文件夹的大小。

Here is how I distribute my package: 这是我分发包裹的方式:

  1. copy NW.js binaries client to dist folder 将NW.js二进制客户端复制到dist文件夹

  2. copy my working source project into a folder named package.nw (Windows) or app.nw in nwjs.app/Contents/Resources/ (MacOS) 将我正在工作的源项目复制到名为package.nw (Windows)或app.nw中的nwjs.app/Contents/Resources/的文件夹中

  3. run npm prune --production under the path you just copy your source into. 在您将源代码复制到的路径下运行npm prune --production https://docs.npmjs.com/cli/prune.html https://docs.npmjs.com/cli/prune.html

  4. using npm package plist (for MacOS) or rcedit (for Windows) to change the binaries client's information about version, nanme, author ..etc 使用npm软件包plist (对于MacOS)或rcedit (对于Windows)更改二进制客户端有关版本,nanme,author..etc的信息

For mac these is alot of things needs to be changed if you want to publish to appstore http://docs.nwjs.io/en/latest/For%20Users/Advanced/Support%20for%20Mac%20App%20Store/ 对于Mac,如果要发布到应用商店http://docs.nwjs.io/en/latest/For%20Users/Advanced/Support%20for%20Mac%20App%20Store/,则需要更改很多内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM