mirror of https://github.com/ColorlibHQ/AdminLTE
Added jshint, clean and image plugins to lint JS files, remove build images and compress images respectively
parent
12996b0242
commit
13aa44fe14
58
Gruntfile.js
58
Gruntfile.js
|
@ -1,6 +1,15 @@
|
|||
'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: {
|
||||
// If any .less file changes in directory "build/less/" run the "less"-task.
|
||||
|
@ -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,8 +142,12 @@ 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…
Reference in New Issue