Created
April 9, 2014 05:51
-
-
Save dgtlmonk/10229747 to your computer and use it in GitHub Desktop.
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
// 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