From 58d82435d280cfd8ac19d312e8bb226bd9a2271e Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 7 Nov 2014 11:28:55 +0100 Subject: [PATCH] Switch to "serve" verb. The grunt community has moved to using verbs consistently in their task names, so "server" has been renamed "serve"; getting it wrong results in a bizarro error, so this is slightly nicer for newcomers to the project with history in other grunt projects. Change-Id: If1266371d0e548e71f579e440ba7d4e7db07918f --- Gruntfile.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e4f7f226..f1aebd2d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -596,7 +596,7 @@ module.exports = function (grunt) { * source in a local web server. It does no watching, it simply hosts the * files. */ - grunt.registerTask('server:dist', [ + grunt.registerTask('serve:dist', [ 'clean', 'compile', 'package', @@ -610,7 +610,7 @@ module.exports = function (grunt) { * will automatically lint, test, and refresh * the code when a change is detected. */ - grunt.registerTask('server', [ + grunt.registerTask('serve', [ 'clean', 'compile', 'configureProxies:livereload', @@ -619,6 +619,17 @@ module.exports = function (grunt) { 'watch' ]); + /** + * Support the old non-verb form of invoking `serve` but warn. + */ + grunt.registerTask('server', + 'DEPRECATED TASK. Use the "serve" task instead', + function (target) { + grunt.log.warn('The `server` task has been deprecated. Use ' + + '`grunt serve` to start a server.'); + grunt.task.run(['serve:' + target]); + }); + /** * grunt test:integration *