AdminLTE/Gruntfile.js

68 lines
2.6 KiB
JavaScript
Raw Normal View History

2015-02-01 21:25:09 +00:00
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
2015-02-02 16:52:30 +00:00
grunt.loadNpmTasks('grunt-contrib-uglify');
2015-02-01 21:25:09 +00:00
grunt.initConfig({
watch: {
// 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-02-02 16:52:30 +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: {
//Development not compressed
development: {
options: {
2015-02-02 16:52:30 +00:00
//Wether to compress or not
2015-02-01 21:25:09 +00:00
compress: false
},
files: {
// compilation.css : source.less
"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 21:25:09 +00:00
}
},
//production compresses version
production: {
options: {
2015-02-02 16:52:30 +00:00
//Wether to compress or not
2015-02-01 21:25:09 +00:00
compress: true
},
files: {
// compilation.css : source.less
"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 21:25:09 +00:00
}
}
2015-02-02 16:52:30 +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-02-01 21:25:09 +00:00
}
});
// the default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};