【问题标题】:How to package node webkit app如何打包 node webkit 应用程序
【发布时间】:2015-01-06 12:17:50
【问题描述】:

我正在开发我的第一个节点 webkit 应用程序。我对打包文件感到困惑。最终产品是可以执行的单个文件吗?

The end result will not be a single executable, you must also include some DLLs in your zip-file. 

github中的这些行让我更加困惑。

  • 如何包装?
  • 我需要将 webkit 文件也包含在包中还是只包含我创建的文件?

【问题讨论】:

    标签: node.js webkit node-webkit


    【解决方案1】:

    我使用下面的 gulp 脚本成功地为各种平台打包了我的 node-webkit 应用程序。以下是不言自明的脚本。

    参考:https://github.com/nwjs/nwbuilder/blob/master/example/Gulpfile.js

    var NwBuilder = require('nw-builder');
    var gulp = require('gulp');
    var gutil = require('gulp-util');
    
    gulp.task('nw', function () {
    
        var nw = new NwBuilder({
            version: '0.12.3',
            files: '../nodepoc/**',
            platforms: ['osx64','win32','win64']
    
        });
    
        // Log stuff you want
        nw.on('log', function (msg) {
            gutil.log('nw-builder', msg);
        });
    
        // Build returns a promise, return it so the task isn't called in parallel
        return nw.build().catch(function (err) {
            gutil.log('nw-builder', err);
        });
    });
    
    gulp.task('default', ['nw']);
    

    将文件另存为gulpFile.js。在终端中,只需在与 gulpFile.js 相同的位置运行 gulp 命令,它将为平台下载必要的 node-webkit 发行版并为您构建包。

    【讨论】:

      猜你喜欢
      • 2015-10-19
      • 2016-06-08
      • 2014-06-26
      • 2014-04-22
      • 2016-11-30
      • 2013-10-10
      • 2014-09-13
      • 2013-10-01
      • 2013-05-23
      相关资源
      最近更新 更多