Added jshint, clean and image plugins to lint JS files, remove build images and compress images respectively

pull/489/merge
Abdullah Almsaeed 9 years ago
parent 12996b0242
commit 13aa44fe14

@ -1,5 +1,14 @@
'use strict';
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
watch: {
@ -86,15 +95,40 @@ module.exports = function (grunt) {
}
}
},
cssjanus: {
build: {
files: {
'dist/css/AdminLTE-rtl.css': 'dist/css/AdminLTE.css',
'dist/css/AdminLTE-rtl.min.css': 'dist/css/AdminLTE.min.css',
'bootstrap/css/bootstrap-rtl.css': 'bootstrap/css/bootstrap.css',
'bootstrap/css/bootstrap-rtl.min.css': 'bootstrap/css/bootstrap.min.css'
}
// Optimize images
image: {
dynamic: {
files: [{
expand: true,
cwd: 'build/img/',
src: ['**/*.{png,jpg,gif,svg}'],
dest: 'dist/img/'
}]
}
},
// Validate JS code
jshint: {
options: {
jshintrc: '.jshintrc'
},
core: {
src: 'dist/js/app.js'
},
demo: {
src: 'dist/js/demo.js'
},
pages: {
src: 'dist/js/pages/*.js'
}
},
// Delete images in build directory
// After compressing the images in the build/img dir, there is no need
// for them
clean: {
build: ["build/img/*"]
}
});
@ -108,9 +142,13 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
// Include Files Within HTML
grunt.loadNpmTasks('grunt-includes');
// Convert CSS to RTL
grunt.loadNpmTasks('grunt-cssjanus');
// Optimize images
grunt.loadNpmTasks('grunt-image');
// Validate JS code
grunt.loadNpmTasks('grunt-contrib-jshint');
// Delete not needed files
grunt.loadNpmTasks('grunt-contrib-clean');
// The default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};
};
Loading…
Cancel
Save