Last active
May 4, 2016 19:46
-
-
Save primaryobjects/932d4330f75582f625b80557ed247426 to your computer and use it in GitHub Desktop.
Example grunt file for building an nwjs desktop app package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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']); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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