Skip to content

Commit

Permalink
MDL-51582 grunt: task improvements
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
danpoltawski committed Dec 4, 2015
1 parent 868e35a commit 65d070a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand All @@ -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);
Expand Down

0 comments on commit 65d070a

Please sign in to comment.