module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
server: {
port: 8888,
base: \'.\'
}
});
};
C:\\P
The server
task only runs as long as it is needed, but you can keep it from quitting. From a comment by widget on another question: In your grunt.js
file define a task named run
that runs the tasks server
and watch
.
grunt.registerTask("run", "server watch");
The watch
task runs indefinitely, so it prevents the server
task from ending. Just make sure you also have a config for the watch
task. Here it is all together in your grunt.js
file:
module.exports = function (grunt) {
// …
grunt.initConfig({
// …
watch: {
files: "",
tasks: "lint qunit",
},
// …
});
grunt.registerTask("run", "server watch");
};
From the command line just type:
$ grunt run
The server will stay up and running.
Alternatively, as @NateBarr points out, from the command line you can run:
$ grunt server watch