angular pack (two): nw.js

1 npm build ng to compile dist

2 alone write a package.json on dist folder.

{
  "name": "app",
  "main": "index.html"
}

3 dist folder into nwjs-sdk-v0.42.2-win- x64 dist the folder renamed package.nw 

4 with the entire enigmavirtualbox nwjs-sdk-v0.42.2-win-x64 packaged into a exe.

 

 

 

------------Mark------------------

With nw.js is packaged into a stand-alone program type exe. Ng suited to such a one-page application directly when using a stand-alone program.

Disadvantages:

A bulky package 300M;

After 2 Start memory consumption: a small application must 1G memory. 5 process, each 200M memory.

Advantages (electron and comparison):

1 fully supports all api chrome and nodejs, such as print preview.

2 does not need to rewrite the code. Main.js do not need to write such a configuration file

For Internet deployment in inconvenient places, or nw.js more convenient.

 

But the process is almost no pit.

But little attention to a few places. The dist folder into a zip and then renamed exe app.nw then merged into this move, it is occasionally fail. Performance is:

The packaged dist not be dragged to start on nw.exe, but after the merger package, start displaying empty nw.js

This wonderful question, nw.js need to refer to the official website: http://docs.nwjs.io/en/latest/For%20Users/Package%20and%20Distribute/#package-your-app

The first method, get.

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/xuanmanstein/p/11821113.html