2015-02-01 21:25:09 +00:00
|
|
|
'use strict';
|
|
|
|
module.exports = function (grunt) {
|
2015-04-15 23:07:57 +00:00
|
|
|
|
2015-02-01 21:25:09 +00:00
|
|
|
grunt.initConfig({
|
|
|
|
watch: {
|
2015-04-15 23:07:57 +00:00
|
|
|
// If any .less file changes in directory "build/less/" run the "less"-task.
|
2015-02-02 18:38:02 +00:00
|
|
|
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"],
|
2015-02-02 16:52:30 +00:00
|
|
|
tasks: ["less", "uglify"]
|
2015-02-01 21:25:09 +00:00
|
|
|
},
|
|
|
|
// "less"-task configuration
|
2015-04-15 23:07:57 +00:00
|
|
|
// This task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
|
2015-02-01 21:25:09 +00:00
|
|
|
less: {
|
2015-04-15 23:07:57 +00:00
|
|
|
// Development not compressed
|
2015-02-01 21:25:09 +00:00
|
|
|
development: {
|
|
|
|
options: {
|
2015-04-15 23:07:57 +00:00
|
|
|
// Whether to compress or not
|
2015-02-01 21:25:09 +00:00
|
|
|
compress: false
|
|
|
|
},
|
|
|
|
files: {
|
2015-04-03 15:56:51 +00:00
|
|
|
// compilation.css : source.less
|
2015-02-04 18:27:27 +00:00
|
|
|
"dist/css/AdminLTE.css": "build/less/AdminLTE.less",
|
2015-04-03 15:56:51 +00:00
|
|
|
//Non minified skin files
|
2015-02-04 18:27:27 +00:00
|
|
|
"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",
|
2015-04-03 15:56:51 +00:00
|
|
|
"dist/css/skins/skin-blue-light.css": "build/less/skins/skin-blue-light.less",
|
|
|
|
"dist/css/skins/skin-black-light.css": "build/less/skins/skin-black-light.less",
|
|
|
|
"dist/css/skins/skin-yellow-light.css": "build/less/skins/skin-yellow-light.less",
|
|
|
|
"dist/css/skins/skin-green-light.css": "build/less/skins/skin-green-light.less",
|
|
|
|
"dist/css/skins/skin-red-light.css": "build/less/skins/skin-red-light.less",
|
|
|
|
"dist/css/skins/skin-purple-light.css": "build/less/skins/skin-purple-light.less",
|
2015-02-04 18:27:27 +00:00
|
|
|
"dist/css/skins/_all-skins.css": "build/less/skins/_all-skins.less"
|
2015-02-01 21:25:09 +00:00
|
|
|
}
|
|
|
|
},
|
2015-04-15 23:07:57 +00:00
|
|
|
// Production compresses version
|
2015-02-01 21:25:09 +00:00
|
|
|
production: {
|
|
|
|
options: {
|
2015-04-15 23:07:57 +00:00
|
|
|
// Whether to compress or not
|
2015-02-01 21:25:09 +00:00
|
|
|
compress: true
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
// compilation.css : source.less
|
2015-04-15 23:07:57 +00:00
|
|
|
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less",
|
|
|
|
// Skins minified
|
2015-02-04 18:27:27 +00:00
|
|
|
"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",
|
2015-04-03 15:56:51 +00:00
|
|
|
"dist/css/skins/skin-blue-light.min.css": "build/less/skins/skin-blue-light.less",
|
|
|
|
"dist/css/skins/skin-black-light.min.css": "build/less/skins/skin-black-light.less",
|
|
|
|
"dist/css/skins/skin-yellow-light.min.css": "build/less/skins/skin-yellow-light.less",
|
|
|
|
"dist/css/skins/skin-green-light.min.css": "build/less/skins/skin-green-light.less",
|
|
|
|
"dist/css/skins/skin-red-light.min.css": "build/less/skins/skin-red-light.less",
|
|
|
|
"dist/css/skins/skin-purple-light.min.css": "build/less/skins/skin-purple-light.less",
|
2015-02-04 18:27:27 +00:00
|
|
|
"dist/css/skins/_all-skins.min.css": "build/less/skins/_all-skins.less"
|
2015-02-01 21:25:09 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-02 16:52:30 +00:00
|
|
|
},
|
2015-04-15 23:07:57 +00:00
|
|
|
// Uglify task info. Compress the js files.
|
2015-02-02 16:52:30 +00:00
|
|
|
uglify: {
|
|
|
|
options: {
|
2015-02-02 18:38:02 +00:00
|
|
|
mangle: true,
|
|
|
|
preserveComments: 'some'
|
2015-02-02 16:52:30 +00:00
|
|
|
},
|
|
|
|
my_target: {
|
|
|
|
files: {
|
|
|
|
'dist/js/app.min.js': ['dist/js/app.js']
|
|
|
|
}
|
|
|
|
}
|
2015-03-02 23:39:46 +00:00
|
|
|
},
|
2015-04-15 23:07:57 +00:00
|
|
|
// Build the documentation files
|
2015-03-02 23:39:46 +00:00
|
|
|
includes: {
|
|
|
|
build: {
|
|
|
|
src: ['*.html'], // Source files
|
|
|
|
dest: 'documentation/', // Destination directory
|
|
|
|
flatten: true,
|
|
|
|
cwd: 'documentation/build',
|
|
|
|
options: {
|
|
|
|
silent: true,
|
|
|
|
includePath: 'documentation/build/include'
|
2015-04-15 23:07:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
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'
|
2015-03-02 23:39:46 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-01 21:25:09 +00:00
|
|
|
}
|
|
|
|
});
|
2015-04-15 23:07:57 +00:00
|
|
|
|
|
|
|
// Load all grunt tasks
|
|
|
|
|
|
|
|
// LESS Compiler
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
// Watch File Changes
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
// Compress JS Files
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
// Include Files Within HTML
|
|
|
|
grunt.loadNpmTasks('grunt-includes');
|
|
|
|
// Convert CSS to RTL
|
|
|
|
grunt.loadNpmTasks('grunt-cssjanus');
|
|
|
|
|
|
|
|
// The default task (running "grunt" in console) is "watch"
|
2015-02-01 21:25:09 +00:00
|
|
|
grunt.registerTask('default', ['watch']);
|
2015-04-15 23:07:57 +00:00
|
|
|
};
|