在node-webkit-builder之后运行nw app

时间:2016-02-27 21:20:03

标签: node.js gulp node-webkit

使用node-webkit-builder构建第一个应用。拥有win64版本,在Windows上运行,处理存在,可以在经理上看到这个,但是应用程序没有打开。

Lubuntu 15.04

没有错误......

的package.json

{
  "main": "index.html",
  "name": "TorkGame.",
  "description": "Tork game on phaserJS and NW.",
  "version": "0.0.1",
  "keywords": [
    "Tork",
    "demo",
    "node-webkit"
  ],
  "window": {
    "title": "Tork game",
    "toolbar": false,
    "frame": true,
    "width": 500,
    "height": 500,
    "position": "mouse",
    "min_width": 500,
    "min_height": 500,
    "max_width": 500,
    "max_height": 500
  },
  "webkit": {
    "plugin": true
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-util": "^3.0.7",
    "node-webkit-builder": "^1.0.13"
  }
}

gulpfile.js

var NwBuilder = require('node-webkit-builder');
var gulp = require('gulp');
var gutil = require('gulp-util');

gulp.task('default', function () {

    var nw = new NwBuilder({
        version: '0.12.3',
        files: [ './**'],
        platforms: ['win32', 'win64'] // change this to 'win' for/on windows
    });

    // Log stuff you want
    nw.on('log', function (msg) {
        gutil.log('node-webkit-builder', msg);
    });

    // Build returns a promise, return it so the task isn't called in parallel
    return nw.build().catch(function (err) {
        gutil.log('node-webkit-builder', err);
    });
});

0 个答案:

没有答案