我正在开发我的第一个节点webkit应用程序。我对包装文件感到困惑。最终产品是否可以执行单个文件?
The end result will not be a single executable, you must also include some DLLs in your zip-file.
github中的这些行让我更加困惑。
答案 0 :(得分:0)
我使用下面的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发行版并为你构建软件包。