From 65d070aec867f68b75596908529d9588c12bdc34 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Tue, 24 Nov 2015 18:13:02 +0000 Subject: [PATCH] MDL-51582 grunt: task improvements * Introduce the 'css' task - this will give us flexibility to do things in future rather than relying on the inbuilt 'less' task (e.g. sourcemap generating task which doesn't run by default) * Introduce 'amd' task which runs only amd tasks * Introduce 'js' task which runs all JS (amd/shifter) tasks * Tweak the ordering so that slow shifter always runs last (useful for people like me who forget to specif the task) --- Gruntfile.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 987156a4515..dcc22a8f34f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -219,14 +219,11 @@ module.exports = function(grunt) { grunt.task.run('shifter'); // Are we in an AMD directory? } else if (path.basename(cwd) == 'amd') { - grunt.task.run('jshint'); - grunt.task.run('uglify'); + grunt.task.run('amd'); } else { // Run them all!. - grunt.task.run('shifter'); - grunt.task.run('jshint'); - grunt.task.run('uglify'); - grunt.task.run('less'); + grunt.task.run('css'); + grunt.task.run('js'); } }; @@ -236,8 +233,13 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); - // Register the shifter task. + // Register JS tasks. grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter); + grunt.registerTask('amd', ['jshint', 'uglify']); + grunt.registerTask('js', ['amd', 'shifter']); + + // Register CSS taks. + grunt.registerTask('css', ['less:bootstrapbase']); // Register the startup task. grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup); -- 2.43.0