Skip to content

Instantly share code, notes, and snippets.

@zenorocha
Last active February 25, 2019 14:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zenorocha/fe380eed5fe55ceb1f0b to your computer and use it in GitHub Desktop.
Save zenorocha/fe380eed5fe55ceb1f0b to your computer and use it in GitHub Desktop.
Building NodeWebkit apps with Gulp

Tasks

To install the task-runner, run:

$ npm install -g gulp

To install local dependencies, run:

$ npm install

To serve the app in node-webkit, run:

$ gulp serve

To build the app for Mac OSx & Window, run:

$ gulp build
var pkg = require('./package');
var gulp = require('gulp');
var gutil = require('gulp-util');
var rimraf = require('rimraf');
var shell = require('gulp-shell');
var NwBuilder = require('node-webkit-builder');
gulp.task('build', ['clean'], function() {
var nw = new NwBuilder({
appName: pkg.window.title,
appVersion: pkg.version,
buildDir: 'dist',
files: ['package.json', 'src/**'],
macIcns: 'src/img/icon.icns',
platforms: ['win','osx'],
version: '0.10.1'
});
nw.on('log', gutil.log);
return nw.build().catch(gutil.log);
});
gulp.task('clean', function (cb) {
rimraf('dist', cb);
});
gulp.task('serve', shell.task([
'./node_modules/nodewebkit/bin/nodewebkit . --debug'
]));
{
"private": true,
"devDependencies": {
"gulp": "^3.8.7",
"gulp-shell": "^0.2.9",
"gulp-util": "~3.0.0",
"node-webkit-builder": "~0.1.1",
"rimraf": "~2.2.8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment