Skip to content

Instantly share code, notes, and snippets.

@dgtlmonk
Created April 9, 2014 05:51
Show Gist options
  • Save dgtlmonk/10229747 to your computer and use it in GitHub Desktop.
Save dgtlmonk/10229747 to your computer and use it in GitHub Desktop.
// package.json
{
"name": "application",
"version": "0.0.1",
"private": true,
"dependencies": {},
"devDependencies": {
"matchdep": "^0.3.0",
"grunt": "^0.4.4",
"grunt-contrib-watch": "^0.6.1",
"grunt-open": "^0.2.3",
"grunt-express": "^1.2.1"
}
}
// Gruntfile.js
module.exports = function(grunt) {
// Load Grunt task declared in the package.json file
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
express: {
all :{
options:{
port:9000,
hostname:"0.0.0.0",
bases: ['public'],
livereload: true,
}
}
},
open: {
all:{
// gets the port from the connect configuration
path: 'http://localhost:<%= express.all.options.port %>'
}
},
watch:{
all: {
files :['index.html','**/*.css','**/*.js'],
options: {
livereload:true,
spawn: false
}
}
}
});
grunt.registerTask('server',[
// 'express',
// 'open'
'watch'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment