mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
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)
This commit is contained in:
parent
868e35a058
commit
65d070aec8
16
Gruntfile.js
16
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user