Last active
August 29, 2015 14:18
-
-
Save automaticgiant/2df64c748bcdfc8103d2 to your computer and use it in GitHub Desktop.
Simple hw4 grunt setup - use livereload plugin or add connect livereload middleware
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) { | |
var assignment = 'HW5'; | |
var files = [assignment + '.html', assignment + '.css', assignment + '.js'] | |
var addr; | |
var lookup = require('deasync')(require('dns').lookup); | |
addr = lookup(require('os').hostname()); | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
connect: { | |
options: { | |
port: 8080, | |
base: './', | |
hostname: addr, | |
livereload: true | |
}, | |
server: { | |
options: { | |
hostname: addr | |
} | |
}, | |
local: { | |
options: { | |
hostname: 'localhost' | |
} | |
} | |
}, | |
watch: { | |
options: { | |
reload: true, | |
livereload: true | |
}, | |
hw5: { | |
files: ['Gruntfile.js'].concat(files) | |
}, | |
hw5pack: { | |
files: files | |
, tasks: ['shell:package'] | |
, debounceDelay: 5000 | |
} | |
}, | |
shell: { | |
package: { | |
command: 'jar cvf ' + assignment + 'kp1108.jar ' + files.join(' ') | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.loadNpmTasks('grunt-shell'); | |
// Default task(s). | |
grunt.registerTask('default', ['shell:package', 'connect', 'watch']); | |
// grunt.registerTask('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
{ | |
"name": "hw5", | |
"version": "1.0.0", | |
"description": "cs3744 hw5", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "grunt" | |
}, | |
"author": "automaticgiant", | |
"license": "GPLv2", | |
"dependencies": { | |
"connect": "^3.3.5", | |
"grunt": "^0.4.5", | |
"grunt-contrib-connect": "^0.10.1", | |
"grunt-contrib-watch": "^0.6.1", | |
"grunt-shell": "^1.1.2", | |
"deasync": "0.0.10" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now with 2x the bound IPs!