Skip to content

Instantly share code, notes, and snippets.

@automaticgiant
Last active August 29, 2015 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save automaticgiant/2df64c748bcdfc8103d2 to your computer and use it in GitHub Desktop.
Save automaticgiant/2df64c748bcdfc8103d2 to your computer and use it in GitHub Desktop.
Simple hw4 grunt setup - use livereload plugin or add connect livereload middleware
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')
};
{
"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"
}
}
@automaticgiant
Copy link
Author

Now with 2x the bound IPs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment