Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Last active May 4, 2016 19:46
Show Gist options
  • Select an option

  • Save primaryobjects/932d4330f75582f625b80557ed247426 to your computer and use it in GitHub Desktop.

Select an option

Save primaryobjects/932d4330f75582f625b80557ed247426 to your computer and use it in GitHub Desktop.
Example grunt file for building an nwjs desktop app package.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
nwjs: {
options: {
platforms: ['win64', 'osx64'],
buildDir: './builds',
macZip: true
},
src: ['../myapp/**/*']
},
zip: {
'win': {
cwd: 'builds/myapp/win64/',
src: ['builds/myapp/win64/**'],
dest: 'builds/myapp/win64/win64.zip',
},
'osx64': {
cwd: 'builds/myapp/osx64/',
src: ['builds/myapp/osx64/**'],
dest: 'builds/myapp/osx64/osx64.zip',
}
},
bgShell: {
_defaults: {
bg: false
},
flatten: {
cmd: 'flatten-packages ../myapp'
}
}
});
// Load the plugin that provides the "node-webkit" task.
grunt.loadNpmTasks('grunt-nw-builder');
grunt.loadNpmTasks('grunt-zip');
grunt.loadNpmTasks('grunt-bg-shell');
// Default task(s).
grunt.registerTask('default', ['bgShell', 'nwjs', 'zip']);
};
{
"name": "myappGrunt",
"version": "0.0.1",
"engines": {
"node": "*",
"npm": "*"
},
"devDependencies": {
"grunt": "0.4.*",
"grunt-nw-builder": "*",
"grunt-zip": "*",
"grunt-bg-shell": "*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment