module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
server: {
port: 8888,
base: \'.\'
}
});
};
C:\\P
By default Grunt starts up the server just for testing (or any other task asked..) and as soon as it's done it exits....
But fortunately I found a solution which by adding this to your grunt.js
file will let you (optionally) halt the server from exiting.
grunt.registerTask('wait', 'Wait for a set amount of time.', function(delay) {
var d = delay ? delay + ' second' + (delay === '1' ? '' : 's') : 'forever';
grunt.log.write('Waiting ' + d + '...');
// Make this task asynchronous. Grunt will not continue processing
// subsequent tasks until done() is called.
var done = this.async();
// If a delay was specified, call done() after that many seconds.
if (delay) { setTimeout(done, delay * 1000); }
});
Then in your command line call it: grunt server wait
then you should be able to see it in the browser..
Make sure you add it inside module.exports = function(grunt){...}