2015-02-01 22:25:09 +01:00
|
|
|
'use strict';
|
|
|
|
module.exports = function (grunt) {
|
|
|
|
// load all grunt tasks
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2015-02-02 17:52:30 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
2015-03-03 00:39:46 +01:00
|
|
|
grunt.loadNpmTasks('grunt-includes');
|
|
|
|
|
2015-02-01 22:25:09 +01:00
|
|
|
grunt.initConfig({
|
|
|
|
watch: {
|
|
|
|
// if any .less file changes in directory "build/less/" run the "less"-task.
|
2015-02-02 19:38:02 +01:00
|
|
|
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"],
|
2015-02-02 17:52:30 +01:00
|
|
|
tasks: ["less", "uglify"]
|
2015-02-01 22:25:09 +01:00
|
|
|
},
|
|
|
|
// "less"-task configuration
|
2015-02-02 17:52:30 +01:00
|
|
|
//this task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
|
2015-02-01 22:25:09 +01:00
|
|
|
less: {
|
|
|
|
//Development not compressed
|
|
|
|
development: {
|
|
|
|
options: {
|
2015-02-02 17:52:30 +01:00
|
|
|
//Wether to compress or not
|
2015-02-01 22:25:09 +01:00
|
|
|
compress: false
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
// compilation.css : source.less
|
2015-02-04 19:27:27 +01:00
|
|
|
"dist/css/AdminLTE.css": "build/less/AdminLTE.less",
|
|
|
|
"dist/css/skins/skin-blue.css": "build/less/skins/skin-blue.less",
|
|
|
|
"dist/css/skins/skin-black.css": "build/less/skins/skin-black.less",
|
|
|
|
"dist/css/skins/skin-yellow.css": "build/less/skins/skin-yellow.less",
|
|
|
|
"dist/css/skins/skin-green.css": "build/less/skins/skin-green.less",
|
|
|
|
"dist/css/skins/skin-red.css": "build/less/skins/skin-red.less",
|
|
|
|
"dist/css/skins/skin-purple.css": "build/less/skins/skin-purple.less",
|
|
|
|
"dist/css/skins/_all-skins.css": "build/less/skins/_all-skins.less"
|
2015-02-01 22:25:09 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
//production compresses version
|
|
|
|
production: {
|
|
|
|
options: {
|
2015-02-02 17:52:30 +01:00
|
|
|
//Wether to compress or not
|
2015-02-01 22:25:09 +01:00
|
|
|
compress: true
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
// compilation.css : source.less
|
2015-02-04 19:27:27 +01:00
|
|
|
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less",
|
|
|
|
"dist/css/skins/skin-blue.min.css": "build/less/skins/skin-blue.less",
|
|
|
|
"dist/css/skins/skin-black.min.css": "build/less/skins/skin-black.less",
|
|
|
|
"dist/css/skins/skin-yellow.min.css": "build/less/skins/skin-yellow.less",
|
|
|
|
"dist/css/skins/skin-green.min.css": "build/less/skins/skin-green.less",
|
|
|
|
"dist/css/skins/skin-red.min.css": "build/less/skins/skin-red.less",
|
|
|
|
"dist/css/skins/skin-purple.min.css": "build/less/skins/skin-purple.less",
|
|
|
|
"dist/css/skins/_all-skins.min.css": "build/less/skins/_all-skins.less"
|
2015-02-01 22:25:09 +01:00
|
|
|
}
|
|
|
|
}
|
2015-02-02 17:52:30 +01:00
|
|
|
},
|
2015-02-04 19:27:27 +01:00
|
|
|
//Uglify task info. Compress the js files.
|
2015-02-02 17:52:30 +01:00
|
|
|
uglify: {
|
|
|
|
options: {
|
2015-02-02 19:38:02 +01:00
|
|
|
mangle: true,
|
|
|
|
preserveComments: 'some'
|
2015-02-02 17:52:30 +01:00
|
|
|
},
|
|
|
|
my_target: {
|
|
|
|
files: {
|
|
|
|
'dist/js/app.min.js': ['dist/js/app.js']
|
|
|
|
}
|
|
|
|
}
|
2015-03-03 00:39:46 +01:00
|
|
|
},
|
|
|
|
//Build the documentaion files
|
|
|
|
includes: {
|
|
|
|
build: {
|
|
|
|
src: ['*.html'], // Source files
|
|
|
|
dest: 'documentation/', // Destination directory
|
|
|
|
flatten: true,
|
|
|
|
cwd: 'documentation/build',
|
|
|
|
options: {
|
|
|
|
silent: true,
|
|
|
|
includePath: 'documentation/build/include'
|
|
|
|
//banner: '<!-- I am a banner <% includes.files.dest %> -->'
|
|
|
|
}
|
|
|
|
}
|
2015-02-01 22:25:09 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
// the default task (running "grunt" in console) is "watch"
|
|
|
|
grunt.registerTask('default', ['watch']);
|
|
|
|
};
|